Skip to content

Commit

Permalink
grains exercise: Split into introduction and instructions (#2524)
Browse files Browse the repository at this point in the history
  • Loading branch information
tasxatzial authored Feb 1, 2025
1 parent 8b5bd7c commit f8c8c35
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
15 changes: 0 additions & 15 deletions exercises/grains/description.md

This file was deleted.

11 changes: 11 additions & 0 deletions exercises/grains/instructions.md
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
6 changes: 6 additions & 0 deletions exercises/grains/introduction.md
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.

0 comments on commit f8c8c35

Please sign in to comment.