Skip to content

Commit 218e961

Browse files
Sync connect tests (exercism#290)
1 parent e9c7122 commit 218e961

3 files changed

Lines changed: 43 additions & 3 deletions

File tree

exercises/practice/connect/.meta/tests.toml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,12 @@ description = "nobody wins crossing adjacent angles"
2323
[cd61c143-92f6-4a8d-84d9-cb2b359e226b]
2424
description = "X wins crossing from left to right"
2525

26+
[495e33ed-30a9-4012-b46e-d7c4d5fe13c3]
27+
description = "X wins with left-hand dead end fork"
28+
29+
[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58]
30+
description = "X wins with right-hand dead end fork"
31+
2632
[73d1eda6-16ab-4460-9904-b5f5dd401d0b]
2733
description = "O wins crossing from top to bottom"
2834

exercises/practice/connect/run_test.v

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,34 @@ fn test_x_wins_crossing_from_left_to_right() {
9696
}
9797
}
9898

99+
fn test_x_wins_with_left_hand_dead_end_fork() {
100+
board := [
101+
'. . X .',
102+
' X X . .',
103+
' . X X X',
104+
' O O O O',
105+
]
106+
if res := winner(board) {
107+
assert res == `X`
108+
} else {
109+
assert false, 'should return X'
110+
}
111+
}
112+
113+
fn test_x_wins_with_right_hand_dead_end_fork() {
114+
board := [
115+
'. . X X',
116+
' X X . .',
117+
' . X X .',
118+
' O O O O',
119+
]
120+
if res := winner(board) {
121+
assert res == `X`
122+
} else {
123+
assert false, 'should return X'
124+
}
125+
}
126+
99127
fn test_o_wins_crossing_from_top_to_bottom() {
100128
board := [
101129
'. O . .',

exercises/practice/piecing-it-together/.docs/instructions.md

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,24 @@ For this exercise, you may assume square pieces, so that the format can be deriv
2424

2525
### Portrait
2626

27-
A portrait jigsaw puzzle with 6 pieces, all of which are border pieces and none are inside pieces. It has 3 rows and 2 columns. The aspect ratio is 1.5 (3/2).
27+
A portrait jigsaw puzzle with 6 pieces, all of which are border pieces and none are inside pieces.
28+
It has 2 columns and 3 rows.
29+
The aspect ratio is 0.666666... (2/3).
2830

2931
![A 2 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-2x3.svg)
3032

3133
### Square
3234

33-
A square jigsaw puzzle with 9 pieces, all of which are border pieces except for the one in the center, which is an inside piece. It has 3 rows and 3 columns. The aspect ratio is 1 (3/3).
35+
A square jigsaw puzzle with 9 pieces, all of which are border pieces except for the one in the center, which is an inside piece.
36+
It has 3 columns and 3 rows.
37+
The aspect ratio is 1.0 (3/3).
3438

3539
![A 3 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-3x3.svg)
3640

3741
### Landscape
3842

39-
A landscape jigsaw puzzle with 12 pieces, 10 of which are border pieces and 2 are inside pieces. It has 3 rows and 4 columns. The aspect ratio is 1.333333... (4/3).
43+
A landscape jigsaw puzzle with 12 pieces, 10 of which are border pieces and 2 are inside pieces.
44+
It has 4 columns and 3 rows.
45+
The aspect ratio is 1.333333... (4/3).
4046

4147
![A 4 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-4x3.svg)

0 commit comments

Comments
 (0)