README.md (1392B) - raw
1 # Grains 2 3 Welcome to Grains on Exercism's Perl 5 Track. 4 If you need help running the tests or submitting your code, check out `HELP.md`. 5 6 ## Instructions 7 8 Calculate the number of grains of wheat on a chessboard given that the number 9 on each square doubles. 10 11 There once was a wise servant who saved the life of a prince. The king 12 promised to pay whatever the servant could dream up. Knowing that the 13 king loved chess, the servant told the king he would like to have grains 14 of wheat. One grain on the first square of a chess board, with the number 15 of grains doubling on each successive square. 16 17 There are 64 squares on a chessboard (where square 1 has one grain, square 2 has two grains, and so on). 18 19 Write code that shows: 20 21 - how many grains were on a given square, and 22 - the total number of grains on the chessboard 23 24 ## For bonus points 25 26 Did you get the tests passing and the code clean? If you want to, these 27 are some additional things you could try: 28 29 - Optimize for speed. 30 - Optimize for readability. 31 32 Then please share your thoughts in a comment on the submission. Did this 33 experiment make the code better? Worse? Did you learn anything from it? 34 35 ## Source 36 37 ### Created by 38 39 - @bistik 40 41 ### Contributed to by 42 43 - @darksuji 44 - @dnmfarrell 45 - @kappa 46 - @kentfredric 47 - @kytrinyx 48 - @m-dango 49 - @rfilipo 50 - @sshine 51 52 ### Based on 53 54 JavaRanch Cattle Drive, exercise 6 - http://www.javaranch.com/grains.jsp