~l3kn/quad

ref: 3f52db33e4aeaeebc4303d15ceb4e17c8651d18b quad/patterns.h -rw-r--r-- 5.8 KiB
3f52db33 — Leon Rische Use rgb surface for grammar 9 months ago
                                                                                
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
#define PATTERN(r0, r1, r2, r3, r4, r5, r6, r7)     \
  r0 + (r1 << 8) + (r2 << 16) + (r3 << 24) +        \
  (r4 << 32) + (r5 << 40) + (r6 << 48) + (r7 << 56)

typedef unsigned long long Pattern;

const Pattern BLACK =
  PATTERN(0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL);

const Pattern WHITE =
  PATTERN(0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL);

const Pattern GRAY1 =
  PATTERN(0b00010001UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00010001UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL);

const Pattern GRAY2 =
  PATTERN(0b01010101UL,
          0b00000000UL,
          0b01010101UL,
          0b00000000UL,
          0b01010101UL,
          0b00000000UL,
          0b01010101UL,
          0b00000000UL);

const Pattern HOR1 =
  PATTERN(0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL);

const Pattern VER1 =
  PATTERN(0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b11111111UL);

const Pattern HOR2 =
  PATTERN(0b00001111UL,
          0b00001111UL,
          0b00001111UL,
          0b00001111UL,
          0b00001111UL,
          0b00001111UL,
          0b00001111UL,
          0b00001111UL);

const Pattern VER2 =
  PATTERN(0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL,
          0b11111111UL);

const Pattern DIAG1 =
  PATTERN(0b00000001UL,
          0b00000010UL,
          0b00000100UL,
          0b00001000UL,
          0b00010000UL,
          0b00100000UL,
          0b01000000UL,
          0b10000000UL);

const Pattern ADIAG1 =
  PATTERN(0b10000000UL,
          0b01000000UL,
          0b00100000UL,
          0b00010000UL,
          0b00001000UL,
          0b00000100UL,
          0b00000010UL,
          0b00000001UL);

const Pattern DIAG2 =
  PATTERN(0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b00000001UL,
          0b11111111UL);

const Pattern ADIAG2 =
  PATTERN(0b00000000UL,
          0b00000000UL,
          0b00000000UL,
          0b00001000UL,
          0b00010100UL,
          0b00100010UL,
          0b01000001UL,
          0b10000000UL);

const Pattern patterns[40] = {
  0b0000000000000000000000000000000000000000000000000000000000000000UL,
  0b0000000100000000000000000000000000010000000000000000000000000000UL,
  0b0001000100000000010001000000000000010001000000000100010000000000UL,
  0b0001000100010001010001000100010000010001000100010100010001000100UL,
  0b0001000101010101010001000101010100010001010101010100010001010101UL,
  0b0011001101010101110011000101010100110011010101011100110001010101UL,
  0b0111011101010101110111010101010101110111010101011101110101010101UL,
  0b0111011111011101110111010111011101110111110111011101110101110111UL,
  0b1111111111011101111111110111011111111111110111011111111101110111UL,
  0b1111111111011101111111111111111111111111110111011111111111111111UL,
  0b0000000100001000010000000000010010000000000100000000001000100000UL,
  0b1111111111111111111111111111111111111111111111111111111111111111UL,
  0b0001000101000100000100010100010000010001010001000001000101000100UL,
  0b1000100001000100001000100001000110001000010001000010001000010001UL,
  0b0010001100000001001100000001011011000010010000000000110001100100UL,
  0b1000110100001100110000001101100000011011000000110011000010110001UL,
  0b0101010100000000010101010000000001010101000000000101010100000000UL,
  0b0001000101000100101010100100010000010001010001001010101001000100UL,
  0b0001000110101010010001001010101000010001101010100100010010101010UL,
  0b1110111010111011111011101011101111101110101110111110111010111011UL,
  0b0000000100000000000000000000000000000000000000000000000000000000UL,
  0b0101010110101010010101011010101001010101101010100101010110101010UL,
  0b1100000000100001000100100000110000110000010000001000000010000000UL,
  0b0100000100100010100111000010001001000001100000001000000010000000UL,
  0b0001000100101000010001001000001000010001100000100100010000101000UL,
  0b0000000100000001100000100111110000010000000100000010100011000111UL,
  0b0100010000100000001100010010111001000100111010000001100100001000UL,
  0b0111110100000001000100010001000011010111000100000001000100000001UL,
  0b1010010000010011010011001001000100100110001001000011001001001001UL,
  0b0100010100111001100000100111110101010100100100110010100011010111UL,
  0b0000001000000101000000000000000000100000010100000000000000000000UL,
  0b0000000100000010000001000000000001000000001000000001000000000000UL,
  0b0101010100000000000000010000000000010001000000000000000100000000UL,
  0b1111111100000001000000010000000100000001000000010000000100000001UL,
  0b0001000000111000010001001000001100000001100000000100000000100000UL,
  0b1111111100000001000000010000000111111111000100000001000000010000UL,
  0b0001111100101110010001001110001011110001111010000100010010001110UL,
  0b1111110100000000111111011111110100001101000011010000110100001101UL,
  0b1111111111111110011111011011101001000101100000100000000100000000UL,
  0b0101111110101111010111111010111100000101000010100000010100001010UL
};

/* Pattern patterns[] = { */
/*   BLACK, GRAY1, GRAY2, WHITE, */
/*   HOR1, VER1, HOR2, VER2, */
/*   DIAG1, ADIAG1, DIAG2, ADIAG2 */
/* }; */

/* const Pattern patterns[] = HYPERCARD; */