Your programs must have inline, online, and external documentation. They must be user friendly, and check for errors in user input. They should also have appropriate messages. At this point in the course, use all the features of the language that you have learned, and read the API to apply new ideas to your source.
Once you've looked at the questions, try to divide your solutions into functions and variables. When you need to store something, that's your clue to make a variable. When you need to DO ONE THING, that's your clue to write a function.
1. Island Dice. In the Island Dice Roll game, the player begins with a score of 1000 shells. The player is prompted for the number of shells to risk and a second prompt asks the player to choose either high or low. The player rolls two dice and the outcome is compared to the player’s choice of high or low. If the dice total is between 2 and 6 inclusive, then it is considered low. A total between 8 and 12 inclusive is high. A total of 7 is neither high nor low, and the player looses the shells at risk. If the player has called correctly, the shells at risk are doubled and added to the total shells. For a wrong call, the player loses the shells at risk.
2. The Game of Nim. The game of Nim starts with a random number of stones between 15 and 30. Two players alternate turns and on each turn may take either 1, 2, or 3 stones from the pile. The player forced to take the last stone loses. The computer player will make random choices during their turn. Your program must check to make sure that neither the computer nor the human player attempts to take 3 if there are only 1 or 2 stones left.
Formative Evaluation
If you can't see the document, please read: You Do Not Need Permission To View Any Documents.