-
Notifications
You must be signed in to change notification settings - Fork 0
/
square_enumeration
46 lines (43 loc) · 1.72 KB
/
square_enumeration
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
View the field as an image:
[
[110, 111, 112, 113, 114, 115, 116, 117, 118, 119, 120]
[99 , 100, 101, 102, 103, 104, 105, 106, 107, 108, 109]
[88 , 89 , 90 , 91 , 92 , 93 , 94 , 95 , 96 , 97 , 98 ]
[77 , 78 , 79 , 80 , 81 , 82 , 83 , 84 , 85 , 86 , 87 ]
[66 , 67 , 68 , 69 , 70 , 71 , 72 , 73 , 74 , 75 , 76 ]
[55 , 56 , 57 , 58 , 59 , 60 , 61 , 62 , 63 , 64 , 65 ]
[44 , 45 , 46 , 47 , 48 , 49 , 50 , 51 , 52 , 53 , 54 ]
[33 , 34 , 35 , 36 , 37 , 38 , 39 , 40 , 41 , 42 , 43 ]
[22 , 23 , 24 , 25 , 26 , 27 , 28 , 29 , 30 , 31 , 32 ]
[11 , 12 , 13 , 14 , 15 , 16 , 17 , 18 , 19 , 20 , 21 ]
[0 , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 10 ]
]
Populated valid fields:
[
[ , , , , , X , X , X , X , X , X ]
[ , , , , X , X , X , X , X , X , X ]
[ , , , X , X , X , X , X , X , X , X ]
[ , , X , X , X , X , X , X , X , X , X ]
[ , X , X , X , X , X , X , X , X , X , X ]
[ X , X , X , X , X , X , X , X , X , X , X ]
[ X , X , X , X , X , X , X , X , X , X , ]
[ X , X , X , X , X , X , X , X , X , , ]
[ X , X , X , X , X , X , X , X , , , ]
[ X , X , X , X , X , X , X , , , , ]
[ X , X , X , X , X , X , , , , , ]
]
Als bitboard:
0b1111110000011111110000111111110001111111110011111111110111111111110111111111100111111111000111111110000111111100000111111
Index zu Koordinaten:
Index -> X : Index % 11
Index -> Z : Index / 11
Kompass:
noWe noEa
+11 +12
\ /
west -1 <- 0 -> +1 east
/ \
-12 -11
soWe soEa
Shifts:
Bspw: +7 = bitboard << 7, -7 = bitboard >> 7 ;