File tree Expand file tree Collapse file tree 1 file changed +8
-8
lines changed
exercises/concept/chessboard/.docs Expand file tree Collapse file tree 1 file changed +8
-8
lines changed Original file line number Diff line number Diff 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.
1010It 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.
2020It 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.
3030It should count how many squares are present in the chessboard and returns
3131an integer. Since you don't need to check the content of the squares,
3232consider 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.
4242It should count how many squares are occupied in the chessboard.
4343Return an integer.
4444
4545``` go
46- CountOccupied ()
46+ CountOccupied (board )
4747// => 15
4848```
You can’t perform that action at this time.
0 commit comments