-
-
Notifications
You must be signed in to change notification settings - Fork 546
/
canonical-data.json
267 lines (267 loc) · 7.29 KB
/
canonical-data.json
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
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
{
"exercise": "queen-attack",
"comments": [
"Testing invalid positions will vary by language. The expected value of ",
"'error' is there to indicate some sort of failure should occur, while a 0",
"means no failure. ",
"Some languages implement tests beyond this set, such as checking for two ",
"pieces being placed on the same position, representing the board ",
"graphically, or using standard chess notation. Those tests can be offered",
"as extra credit. ",
" ",
"All row and column positions are considered to be zero-indexed array ",
"indices, where the first row - with index 0 - represents the top of the ",
"board, and the first column - with index 0 - represents the left of the ",
"board. In chess notation that is a8. "
],
"cases": [
{
"description": "Test creation of Queens with valid and invalid positions",
"cases": [
{
"uuid": "3ac4f735-d36c-44c4-a3e2-316f79704203",
"description": "queen with a valid position",
"property": "create",
"input": {
"queen": {
"position": {
"row": 2,
"column": 2
}
}
},
"expected": 0
},
{
"uuid": "4e812d5d-b974-4e38-9a6b-8e0492bfa7be",
"description": "queen must have positive row",
"property": "create",
"input": {
"queen": {
"position": {
"row": -2,
"column": 2
}
}
},
"expected": {
"error": "row not positive"
}
},
{
"uuid": "f07b7536-b66b-4f08-beb9-4d70d891d5c8",
"description": "queen must have row on board",
"property": "create",
"input": {
"queen": {
"position": {
"row": 8,
"column": 4
}
}
},
"expected": {
"error": "row not on board"
}
},
{
"uuid": "15a10794-36d9-4907-ae6b-e5a0d4c54ebe",
"description": "queen must have positive column",
"property": "create",
"input": {
"queen": {
"position": {
"row": 2,
"column": -2
}
}
},
"expected": {
"error": "column not positive"
}
},
{
"uuid": "6907762d-0e8a-4c38-87fb-12f2f65f0ce4",
"description": "queen must have column on board",
"property": "create",
"input": {
"queen": {
"position": {
"row": 4,
"column": 8
}
}
},
"expected": {
"error": "column not on board"
}
}
]
},
{
"description": "Test the ability of one queen to attack another",
"cases": [
{
"uuid": "33ae4113-d237-42ee-bac1-e1e699c0c007",
"description": "cannot attack",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 2,
"column": 4
}
},
"black_queen": {
"position": {
"row": 6,
"column": 6
}
}
},
"expected": false
},
{
"uuid": "eaa65540-ea7c-4152-8c21-003c7a68c914",
"description": "can attack on same row",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 2,
"column": 4
}
},
"black_queen": {
"position": {
"row": 2,
"column": 6
}
}
},
"expected": true
},
{
"uuid": "bae6f609-2c0e-4154-af71-af82b7c31cea",
"description": "can attack on same column",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 4,
"column": 5
}
},
"black_queen": {
"position": {
"row": 2,
"column": 5
}
}
},
"expected": true
},
{
"uuid": "0e1b4139-b90d-4562-bd58-dfa04f1746c7",
"description": "can attack on first diagonal",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 2,
"column": 2
}
},
"black_queen": {
"position": {
"row": 0,
"column": 4
}
}
},
"expected": true
},
{
"uuid": "ff9b7ed4-e4b6-401b-8d16-bc894d6d3dcd",
"description": "can attack on second diagonal",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 2,
"column": 2
}
},
"black_queen": {
"position": {
"row": 3,
"column": 1
}
}
},
"expected": true
},
{
"uuid": "0a71e605-6e28-4cc2-aa47-d20a2e71037a",
"description": "can attack on third diagonal",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 2,
"column": 2
}
},
"black_queen": {
"position": {
"row": 1,
"column": 1
}
}
},
"expected": true
},
{
"uuid": "0790b588-ae73-4f1f-a968-dd0b34f45f86",
"description": "can attack on fourth diagonal",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 1,
"column": 7
}
},
"black_queen": {
"position": {
"row": 0,
"column": 6
}
}
},
"expected": true
},
{
"uuid": "543f8fd4-2597-4aad-8d77-cbdab63619f8",
"description": "cannot attack if falling diagonals are only the same when reflected across the longest falling diagonal",
"property": "canAttack",
"input": {
"white_queen": {
"position": {
"row": 4,
"column": 1
}
},
"black_queen": {
"position": {
"row": 2,
"column": 5
}
}
},
"expected": false
}
]
}
]
}