-
-
Notifications
You must be signed in to change notification settings - Fork 550
/
Copy pathcanonical-data.json
240 lines (240 loc) · 7.36 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
{
"exercise": "triangle",
"comments": [
" Pursuant to discussion in #202, we have decided NOT to test triangles ",
" where all side lengths are positive but a + b = c. e.g: ",
" (2, 4, 2, Isosceles), (1, 3, 4, Scalene). ",
" It's true that the triangle inequality admits such triangles.These ",
" triangles have zero area, however. ",
" They're degenerate triangles with all three vertices collinear. ",
" (In contrast, we will test (0, 0, 0, Illegal), as it is a point) ",
" The tests assert properties of the triangle are true or false. ",
" See: https://github.com/exercism/problem-specifications/issues/379 for disscussion ",
" of this approach ",
" How you handle invalid triangles is up to you. These tests suggest a ",
" triangle is returned, but all of its properties are false. But you ",
" could also have the creation of an invalid triangle return an error ",
" or exception. Choose what is idiomatic for your language. "
],
"cases": [
{
"description": "equilateral triangle",
"cases": [
{
"uuid": "8b2c43ac-7257-43f9-b552-7631a91988af",
"description": "all sides are equal",
"property": "equilateral",
"input": {
"sides": [2, 2, 2]
},
"expected": true
},
{
"uuid": "33eb6f87-0498-4ccf-9573-7f8c3ce92b7b",
"description": "any side is unequal",
"property": "equilateral",
"input": {
"sides": [2, 3, 2]
},
"expected": false
},
{
"uuid": "c6585b7d-a8c0-4ad8-8a34-e21d36f7ad87",
"description": "no sides are equal",
"property": "equilateral",
"input": {
"sides": [5, 4, 6]
},
"expected": false
},
{
"uuid": "16e8ceb0-eadb-46d1-b892-c50327479251",
"description": "all zero sides is not a triangle",
"property": "equilateral",
"input": {
"sides": [0, 0, 0]
},
"expected": false
},
{
"uuid": "3022f537-b8e5-4cc1-8f12-fd775827a00c",
"description": "sides may be floats",
"comments": [
" Your track may choose to skip this test ",
" and deal only with integers if appropriate "
],
"scenarios": ["floating-point"],
"property": "equilateral",
"input": {
"sides": [0.5, 0.5, 0.5]
},
"expected": true
}
]
},
{
"description": "isosceles triangle",
"cases": [
{
"uuid": "cbc612dc-d75a-4c1c-87fc-e2d5edd70b71",
"description": "last two sides are equal",
"property": "isosceles",
"input": {
"sides": [3, 4, 4]
},
"expected": true
},
{
"uuid": "e388ce93-f25e-4daf-b977-4b7ede992217",
"description": "first two sides are equal",
"property": "isosceles",
"input": {
"sides": [4, 4, 3]
},
"expected": true
},
{
"uuid": "d2080b79-4523-4c3f-9d42-2da6e81ab30f",
"description": "first and last sides are equal",
"property": "isosceles",
"input": {
"sides": [4, 3, 4]
},
"expected": true
},
{
"uuid": "8d71e185-2bd7-4841-b7e1-71689a5491d8",
"description": "equilateral triangles are also isosceles",
"property": "isosceles",
"input": {
"sides": [4, 4, 4]
},
"expected": true
},
{
"uuid": "840ed5f8-366f-43c5-ac69-8f05e6f10bbb",
"description": "no sides are equal",
"property": "isosceles",
"input": {
"sides": [2, 3, 4]
},
"expected": false
},
{
"uuid": "2eba0cfb-6c65-4c40-8146-30b608905eae",
"description": "first triangle inequality violation",
"property": "isosceles",
"input": {
"sides": [1, 1, 3]
},
"expected": false
},
{
"uuid": "278469cb-ac6b-41f0-81d4-66d9b828f8ac",
"description": "second triangle inequality violation",
"property": "isosceles",
"input": {
"sides": [1, 3, 1]
},
"expected": false
},
{
"uuid": "90efb0c7-72bb-4514-b320-3a3892e278ff",
"description": "third triangle inequality violation",
"property": "isosceles",
"input": {
"sides": [3, 1, 1]
},
"expected": false
},
{
"uuid": "adb4ee20-532f-43dc-8d31-e9271b7ef2bc",
"description": "sides may be floats",
"comments": [
" Your track may choose to skip this test ",
" and deal only with integers if appropriate "
],
"scenarios": ["floating-point"],
"property": "isosceles",
"input": {
"sides": [0.5, 0.4, 0.5]
},
"expected": true
}
]
},
{
"description": "scalene triangle",
"cases": [
{
"uuid": "e8b5f09c-ec2e-47c1-abec-f35095733afb",
"description": "no sides are equal",
"property": "scalene",
"input": {
"sides": [5, 4, 6]
},
"expected": true
},
{
"uuid": "2510001f-b44d-4d18-9872-2303e7977dc1",
"description": "all sides are equal",
"property": "scalene",
"input": {
"sides": [4, 4, 4]
},
"expected": false
},
{
"uuid": "c6e15a92-90d9-4fb3-90a2-eef64f8d3e1e",
"description": "first and second sides are equal",
"property": "scalene",
"input": {
"sides": [4, 4, 3]
},
"expected": false
},
{
"uuid": "3da23a91-a166-419a-9abf-baf4868fd985",
"description": "first and third sides are equal",
"property": "scalene",
"input": {
"sides": [3, 4, 3]
},
"expected": false
},
{
"uuid": "b6a75d98-1fef-4c42-8e9a-9db854ba0a4d",
"description": "second and third sides are equal",
"property": "scalene",
"input": {
"sides": [4, 3, 3]
},
"expected": false
},
{
"uuid": "70ad5154-0033-48b7-af2c-b8d739cd9fdc",
"description": "may not violate triangle inequality",
"property": "scalene",
"input": {
"sides": [7, 3, 2]
},
"expected": false
},
{
"uuid": "26d9d59d-f8f1-40d3-ad58-ae4d54123d7d",
"description": "sides may be floats",
"comments": [
" Your track may choose to skip this test ",
" and deal only with integers if appropriate "
],
"scenarios": ["floating-point"],
"property": "scalene",
"input": {
"sides": [0.5, 0.4, 0.6]
},
"expected": true
}
]
}
]
}