Skip to content

Commit 20d3dc4

Browse files
authored
Update the chessboard exercise instructions. (#1674)
1 parent ed63018 commit 20d3dc4

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

exercises/concept/chessboard/.docs/instructions.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,43 @@ Each square of the chessboard is identified by a letter-number pair. The vertica
66

77
## 1. Given a Chessboard and a Rank, count how many squares are occupied
88

9-
Decorate the `Chessboard` type with the `CountInRank(rank int) int` function.
9+
Implement the `CountInRank(board Chessboard, rank int) int` function.
1010
It should count occupied squares ranging over a map. Return an integer.
1111

1212
```go
13-
CountInRank(1)
13+
CountInRank(board, 1)
1414
// => 6
1515
```
1616

1717
## 2. Given a Chessboard and a File, count how many squares are occupied
1818

19-
Decorate the `Chessboard` type with the `CountInFile(file int) int` function.
19+
Implement the `CountInFile(board Chessboard, file int) int` function.
2020
It should count occupied squares ranging over the given file. Return an integer.
2121

2222
```go
23-
CountInFile(2)
23+
CountInFile(board, 2)
2424
// => 5
2525
```
2626

2727
## 3. Count how many squares are present in the given chessboard
2828

29-
Decorate the `Chessboard` type with the `CountAll() int` function.
29+
Implement the `CountAll(board Chessboard) int` function.
3030
It should count how many squares are present in the chessboard and returns
3131
an integer. Since you don't need to check the content of the squares,
3232
consider using range omitting both `index` and `value`.
3333

3434
```go
35-
CountAll()
35+
CountAll(board)
3636
// => 64
3737
```
3838

3939
## 4. Count how many squares are occupied in the given chessboard
4040

41-
Decorate the `Chessboard` type with the `CountOccupied() int` function.
41+
Implement the `CountOccupied(board Chessboard) int` function.
4242
It should count how many squares are occupied in the chessboard.
4343
Return an integer.
4444

4545
```go
46-
CountOccupied()
46+
CountOccupied(board)
4747
// => 15
4848
```

0 commit comments

Comments
 (0)