Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions exercises/practice/connect/.meta/tests.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
28 changes: 28 additions & 0 deletions exercises/practice/connect/run_test.v
Original file line number Diff line number Diff line change
Expand Up @@ -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 . .',
Expand Down
12 changes: 9 additions & 3 deletions exercises/practice/piecing-it-together/.docs/instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Loading