|
1 | 1 | {
|
2 | 2 | "exercise": "queen-attack",
|
3 |
| - "version": "1.0.0", |
| 3 | + "version": "2.0.0", |
4 | 4 | "comments": [
|
5 | 5 | "Testing invalid positions will vary by language. The expected",
|
6 | 6 | "value of -1 is there to indicate some sort of failure should",
|
|
18 | 18 | "description": "queen with a valid position",
|
19 | 19 | "property": "create",
|
20 | 20 | "queen": {
|
21 |
| - "position": "(2,2)" |
| 21 | + "position": { |
| 22 | + "row": 2, |
| 23 | + "column": 2 |
| 24 | + } |
22 | 25 | },
|
23 | 26 | "expected": 0
|
24 | 27 | },
|
25 | 28 | {
|
26 |
| - "description": "queen must have positive rank", |
| 29 | + "description": "queen must have positive row", |
27 | 30 | "property": "create",
|
28 | 31 | "queen": {
|
29 |
| - "position": "(-2,2)" |
| 32 | + "position": { |
| 33 | + "row": -2, |
| 34 | + "column": 2 |
| 35 | + } |
30 | 36 | },
|
31 | 37 | "expected": -1
|
32 | 38 | },
|
33 | 39 | {
|
34 |
| - "description": "queen must have rank on board", |
| 40 | + "description": "queen must have row on board", |
35 | 41 | "property": "create",
|
36 | 42 | "queen": {
|
37 |
| - "position": "(8,4)" |
| 43 | + "position": { |
| 44 | + "row": 8, |
| 45 | + "column": 4 |
| 46 | + } |
38 | 47 | },
|
39 | 48 | "expected": -1
|
40 | 49 | },
|
41 | 50 | {
|
42 |
| - "description": "queen must have positive file", |
| 51 | + "description": "queen must have positive column", |
43 | 52 | "property": "create",
|
44 | 53 | "queen": {
|
45 |
| - "position": "(2,-2)" |
| 54 | + "position": { |
| 55 | + "row": 2, |
| 56 | + "column": -2 |
| 57 | + } |
46 | 58 | },
|
47 | 59 | "expected": -1
|
48 | 60 | },
|
49 | 61 | {
|
50 |
| - "description": "queen must have file on board", |
| 62 | + "description": "queen must have column on board", |
51 | 63 | "property": "create",
|
52 | 64 | "queen": {
|
53 |
| - "position": "(4,8)" |
| 65 | + "position": { |
| 66 | + "row": 4, |
| 67 | + "column": 8 |
| 68 | + } |
54 | 69 | },
|
55 | 70 | "expected": -1
|
56 | 71 | }
|
|
63 | 78 | "description": "can not attack",
|
64 | 79 | "property": "canAttack",
|
65 | 80 | "white_queen": {
|
66 |
| - "position": "(2,4)" |
| 81 | + "position": { |
| 82 | + "row": 2, |
| 83 | + "column": 4 |
| 84 | + } |
67 | 85 | },
|
68 | 86 | "black_queen": {
|
69 |
| - "position": "(6,6)" |
| 87 | + "position": { |
| 88 | + "row": 6, |
| 89 | + "column": 6 |
| 90 | + } |
70 | 91 | },
|
71 | 92 | "expected": false
|
72 | 93 | },
|
73 | 94 | {
|
74 |
| - "description": "can attack on same rank", |
| 95 | + "description": "can attack on same row", |
75 | 96 | "property": "canAttack",
|
76 | 97 | "white_queen": {
|
77 |
| - "position": "(2,4)" |
| 98 | + "position": { |
| 99 | + "row": 2, |
| 100 | + "column": 4 |
| 101 | + } |
78 | 102 | },
|
79 | 103 | "black_queen": {
|
80 |
| - "position": "(2,6)" |
| 104 | + "position": { |
| 105 | + "row": 2, |
| 106 | + "column": 6 |
| 107 | + } |
81 | 108 | },
|
82 | 109 | "expected": true
|
83 | 110 | },
|
84 | 111 | {
|
85 |
| - "description": "can attack on same file", |
| 112 | + "description": "can attack on same column", |
86 | 113 | "property": "canAttack",
|
87 | 114 | "white_queen": {
|
88 |
| - "position": "(4,5)" |
| 115 | + "position": { |
| 116 | + "row": 4, |
| 117 | + "column": 5 |
| 118 | + } |
89 | 119 | },
|
90 | 120 | "black_queen": {
|
91 |
| - "position": "(2,5)" |
| 121 | + "position": { |
| 122 | + "row": 2, |
| 123 | + "column": 5 |
| 124 | + } |
92 | 125 | },
|
93 | 126 | "expected": true
|
94 | 127 | },
|
95 | 128 | {
|
96 | 129 | "description": "can attack on first diagonal",
|
97 | 130 | "property": "canAttack",
|
98 | 131 | "white_queen": {
|
99 |
| - "position": "(2,2)" |
| 132 | + "position": { |
| 133 | + "row": 2, |
| 134 | + "column": 2 |
| 135 | + } |
100 | 136 | },
|
101 | 137 | "black_queen": {
|
102 |
| - "position": "(0,4)" |
| 138 | + "position": { |
| 139 | + "row": 0, |
| 140 | + "column": 4 |
| 141 | + } |
103 | 142 | },
|
104 | 143 | "expected": true
|
105 | 144 | },
|
106 | 145 | {
|
107 | 146 | "description": "can attack on second diagonal",
|
108 | 147 | "property": "canAttack",
|
109 | 148 | "white_queen": {
|
110 |
| - "position": "(2,2)" |
| 149 | + "position": { |
| 150 | + "row": 2, |
| 151 | + "column": 2 |
| 152 | + } |
111 | 153 | },
|
112 | 154 | "black_queen": {
|
113 |
| - "position": "(3,1)" |
| 155 | + "position": { |
| 156 | + "row": 3, |
| 157 | + "column": 1 |
| 158 | + } |
114 | 159 | },
|
115 | 160 | "expected": true
|
116 | 161 | },
|
117 | 162 | {
|
118 | 163 | "description": "can attack on third diagonal",
|
119 | 164 | "property": "canAttack",
|
120 | 165 | "white_queen": {
|
121 |
| - "position": "(2,2)" |
| 166 | + "position": { |
| 167 | + "row": 2, |
| 168 | + "column": 2 |
| 169 | + } |
122 | 170 | },
|
123 | 171 | "black_queen": {
|
124 |
| - "position": "(1,1)" |
| 172 | + "position": { |
| 173 | + "row": 1, |
| 174 | + "column": 1 |
| 175 | + } |
125 | 176 | },
|
126 | 177 | "expected": true
|
127 | 178 | },
|
128 | 179 | {
|
129 | 180 | "description": "can attack on fourth diagonal",
|
130 | 181 | "property": "canAttack",
|
131 | 182 | "white_queen": {
|
132 |
| - "position": "(2,2)" |
| 183 | + "position": { |
| 184 | + "row": 2, |
| 185 | + "column": 2 |
| 186 | + } |
133 | 187 | },
|
134 | 188 | "black_queen": {
|
135 |
| - "position": "(5,5)" |
| 189 | + "position": { |
| 190 | + "row": 5, |
| 191 | + "column": 5 |
| 192 | + } |
136 | 193 | },
|
137 | 194 | "expected": true
|
138 | 195 | }
|
|
0 commit comments