SyTen

◆ mapS()

Index syten::SQL::Helpers::mapS ( int  x,
int  y,
int  l,
int  w 
)

Snake-like map.

y->
x 3 2 1 0
| 4 5 6 7
v 11 10 9 8
. . . .
. . . .
. . . .
Parameters
xlength-coordinate, [0, l-1]
ywidth-coordinate, [0, w-1]
llength, [1, …)
wwidth, [1, …)
Returns
0-indexed offset from the start if x != -1 != y and 0 denoting a non-diagonal lattice if x == -1 == y.