diff --git a/exercises/practice/connect/.meta/tests.toml b/exercises/practice/connect/.meta/tests.toml index 59ec615..0fe7d5f 100644 --- a/exercises/practice/connect/.meta/tests.toml +++ b/exercises/practice/connect/.meta/tests.toml @@ -23,6 +23,12 @@ description = "nobody wins crossing adjacent angles" [cd61c143-92f6-4a8d-84d9-cb2b359e226b] description = "X wins crossing from left to right" +[495e33ed-30a9-4012-b46e-d7c4d5fe13c3] +description = "X wins with left-hand dead end fork" + +[ab167ab0-4a98-4d0f-a1c0-e1cddddc3d58] +description = "X wins with right-hand dead end fork" + [73d1eda6-16ab-4460-9904-b5f5dd401d0b] description = "O wins crossing from top to bottom" diff --git a/exercises/practice/connect/run_test.v b/exercises/practice/connect/run_test.v index b27910b..7cdfdff 100644 --- a/exercises/practice/connect/run_test.v +++ b/exercises/practice/connect/run_test.v @@ -96,6 +96,34 @@ fn test_x_wins_crossing_from_left_to_right() { } } +fn test_x_wins_with_left_hand_dead_end_fork() { + board := [ + '. . X .', + ' X X . .', + ' . X X X', + ' O O O O', + ] + if res := winner(board) { + assert res == `X` + } else { + assert false, 'should return X' + } +} + +fn test_x_wins_with_right_hand_dead_end_fork() { + board := [ + '. . X X', + ' X X . .', + ' . X X .', + ' O O O O', + ] + if res := winner(board) { + assert res == `X` + } else { + assert false, 'should return X' + } +} + fn test_o_wins_crossing_from_top_to_bottom() { board := [ '. O . .', diff --git a/exercises/practice/piecing-it-together/.docs/instructions.md b/exercises/practice/piecing-it-together/.docs/instructions.md index c0c9665..8a2781d 100644 --- a/exercises/practice/piecing-it-together/.docs/instructions.md +++ b/exercises/practice/piecing-it-together/.docs/instructions.md @@ -24,18 +24,24 @@ For this exercise, you may assume square pieces, so that the format can be deriv ### Portrait -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). +A portrait jigsaw puzzle with 6 pieces, all of which are border pieces and none are inside pieces. +It has 2 columns and 3 rows. +The aspect ratio is 0.666666... (2/3). ![A 2 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-2x3.svg) ### Square -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). +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 columns and 3 rows. +The aspect ratio is 1.0 (3/3). ![A 3 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-3x3.svg) ### Landscape -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). +A landscape jigsaw puzzle with 12 pieces, 10 of which are border pieces and 2 are inside pieces. +It has 4 columns and 3 rows. +The aspect ratio is 1.333333... (4/3). ![A 4 by 3 jigsaw puzzle](https://assets.exercism.org/images/exercises/piecing-it-together/jigsaw-puzzle-4x3.svg)