-
-
Notifications
You must be signed in to change notification settings - Fork 549
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
grains exercise: Split into introduction and instructions (#2524)
- Loading branch information
1 parent
8b5bd7c
commit f8c8c35
Showing
3 changed files
with
17 additions
and
15 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
# Instructions | ||
|
||
Calculate the number of grains of wheat on a chessboard. | ||
|
||
A chessboard has 64 squares. | ||
Square 1 has one grain, square 2 has two grains, square 3 has four grains, and so on, doubling each time. | ||
|
||
Write code that calculates: | ||
|
||
- the number of grains on a given square | ||
- the total number of grains on the chessboard |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
# Introduction | ||
|
||
There once was a wise servant who saved the life of a prince. | ||
The king promised to pay whatever the servant could dream up. | ||
Knowing that the king loved chess, the servant told the king he would like to have grains of wheat. | ||
One grain on the first square of a chessboard, with the number of grains doubling on each successive square. |