Skip to content

Commit e6a839f

Browse files
Sync exercises (#342)
1 parent 9cf4f70 commit e6a839f

6 files changed

Lines changed: 36 additions & 4 deletions

File tree

exercises/practice/flower-field/.meta/tests.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,3 +44,6 @@ description = "cross"
4444

4545
[dd9d4ca8-9e68-4f78-a677-a2a70fd7a7b8]
4646
description = "large garden"
47+
48+
[6e4ac13a-3e43-4728-a2e3-3551d4b1a996]
49+
description = "multiple adjacent flowers"

exercises/practice/flower-field/source/flower_field.d

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ unittest
4646
assert(annotate(garden) == expected);
4747
}
4848

49-
// garden with only flowers
49+
// Garden full of flowers
5050
{
5151
immutable string[] garden = [
5252
"***",
@@ -190,5 +190,16 @@ unittest
190190
];
191191
assert(annotate(garden) == expected);
192192
}
193+
194+
// Multiple adjacent flowers
195+
{
196+
immutable string[] garden = [
197+
" ** ",
198+
];
199+
string[] expected = [
200+
"1**1",
201+
];
202+
assert(annotate(garden) == expected);
203+
}
193204
}
194205
}

exercises/practice/isbn-verifier/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,12 @@ description = "invalid character in isbn is not treated as zero"
3030
[28025280-2c39-4092-9719-f3234b89c627]
3131
description = "X is only valid as a check digit"
3232

33+
[8005b57f-f194-44ee-88d2-a77ac4142591]
34+
description = "only one check digit is allowed"
35+
36+
[fdb14c99-4cf8-43c5-b06d-eb1638eff343]
37+
description = "X is not substituted by the value 10"
38+
3339
[f6294e61-7e79-46b3-977b-f48789a4945b]
3440
description = "valid isbn without separating dashes"
3541

exercises/practice/isbn-verifier/source/isbn_verifier.d

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ unittest
3232
// X is only valid as a check digit
3333
assert(!isValid("3-598-2X507-9"));
3434

35+
// Only one check digit is allowed
36+
assert(!isValid("3-598-21508-96"));
37+
38+
// X is not substituted by the value 10
39+
assert(!isValid("3-598-2X507-5"));
40+
3541
// Valid isbn without separating dashes
3642
assert(isValid("3598215088"));
3743

exercises/practice/line-up/.docs/instructions.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,9 @@ Yaʻqūb expects to use numbers from 1 up to 999.
55

66
Rules:
77

8-
- Numbers ending in 1 (except for 11) → `"st"`
9-
- Numbers ending in 2 (except for 12) → `"nd"`
10-
- Numbers ending in 3 (except for 13) → `"rd"`
8+
- Numbers ending in 1 (unless ending in 11) → `"st"`
9+
- Numbers ending in 2 (unless ending in 12) → `"nd"`
10+
- Numbers ending in 3 (unless ending in 13) → `"rd"`
1111
- All other numbers → `"th"`
1212

1313
Examples:

exercises/practice/triangle/.docs/instructions.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@ A _scalene_ triangle has all sides of different lengths.
1313

1414
For a shape to be a triangle at all, all sides have to be of length > 0, and the sum of the lengths of any two sides must be greater than or equal to the length of the third side.
1515

16+
~~~~exercism/note
17+
_Degenerate triangles_ are triangles where the sum of the length of two sides is **equal** to the length of the third side, e.g. `1, 1, 2`.
18+
We opted to not include tests for degenerate triangles in this exercise.
19+
You may handle those situations if you wish to do so, or safely ignore them.
20+
~~~~
21+
1622
In equations:
1723

1824
Let `a`, `b`, and `c` be sides of the triangle.

0 commit comments

Comments
 (0)