diff --git a/exercises/practice/connect/.meta/tests.toml b/exercises/practice/connect/.meta/tests.toml index 6ada8773..951b87e5 100644 --- a/exercises/practice/connect/.meta/tests.toml +++ b/exercises/practice/connect/.meta/tests.toml @@ -30,6 +30,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/test_connect.zig b/exercises/practice/connect/test_connect.zig index 4af081a1..25ab147a 100644 --- a/exercises/practice/connect/test_connect.zig +++ b/exercises/practice/connect/test_connect.zig @@ -68,6 +68,26 @@ test "X wins crossing from left to right" { try testing.expectEqual('X', winner(testing.allocator, &board)); } +test "X wins with left-hand dead end fork" { + const board = [_][]const u8{ + ". . X .", // + " X X . .", // + " . X X X", // + " O O O O", + }; + try testing.expectEqual('X', winner(testing.allocator, &board)); +} + +test "X wins with right-hand dead end fork" { + const board = [_][]const u8{ + ". . X X", // + " X X . .", // + " . X X .", // + " O O O O", + }; + try testing.expectEqual('X', winner(testing.allocator, &board)); +} + test "O wins crossing from top to bottom" { const board = [_][]const u8{ ". O . .", // diff --git a/exercises/practice/piecing-it-together/.docs/instructions.md b/exercises/practice/piecing-it-together/.docs/instructions.md index c0c96659..8a2781d9 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)