SierpinskiPath←{
⍝ ⍵ should be 2 integers, to and from
A B←{ ⍝ the alphabet for this version
⍝ of adic is ⍳3
n←⌊3⍟1+⍵×2
z←(¯1+3*n)÷2
(⍳3)[1+(n/3)⊤⍵-z]
}¨⍵
L←(≢A)⌈(≢B)
m←¯1+0⍳⍨(L↑A)=(L↑B)
P←m↓A
Q←m↓B
R←⍬{ ⍝ getting the shortest from A
⍝ to the common ancestor of A and B
0=≢⍵:⍺
p←⍵
t←⌊/∊{/⍨⊃⌽⍸p=⍵}¨⍳3
(⍺,p[t])∇ ⍵↑⍨t-1
}P
('S'('NE')'NW'[R]),'N'('SW')'SE'[Q]
}