SyTen

◆ mapSpiral()

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

Spiral map:

If w is greater than 1:

y->
x 1 2 3 4 5 6 7
| 26 27 28 29 30 31 8
v 25 44 45 46 47 32 9
24 43 54 55 48 33 10
23 42 53 56 49 34 11
22 41 52 51 50 35 12
21 40 39 38 37 36 13
20 19 18 17 16 15 14

If w is equal to 1:

x-> l = 18, w = 1 l/2 = 9
0 2 4 6 8 10 12 14 16 17 15 13 11 9 7 5 3 1