Before beginning any work, do a Team...Pull in your repository.
In this assignment, you will design a game in which one human player is competing against a computer. The human player should also be able to decide if he or she wants to play the first or second move.
It's important to note that while there is a winning strategy for this game, you are required only to implement a computer player which employs random moves.Example output of one game:
Computer starts Round 0, 7 sticks at start, computer took 2, so 5 sticks remain Round 1, 5 sticks at start, human took 1, so 4 sticks remain Round 2, 4 sticks at start, computer took 2, so 2 sticks remain Round 3, 2 sticks at start, human took 1, so 1 sticks remain Round 4, 1 sticks at start, computer took 1, so 0 sticks remain Computer wins
Be careful! A human might enter 5 if 5 sticks are left, and if you are not careful, the human could win by playing in that way.Don't accept the user's input if it is illegal. Continue prompting until you get a valid input.
When you are done with this lab, you must be cleared by the TA to receive credit.
- Do a Team…Pull to update your repository. You must do this or the commit/push below may fail.
- Commit and push all your work to your repository.Make certain this has worked by logging into bitbucket. There you will see the commit(s) in your news feed if it was successful. You can also check the Source page to locate and ensure your code was received.
It is your responsibility to make certain the code has been pushed. Some of your work receives credit through testing of your pushed code. You will receive no credit for such work if you failed to push. We generally reserve the right to revoke credit for any of your work that has not been pushed on-time.
- Fill in the form below with the relevant information
- Have a TA check your work
- The TA should check your work and then fill in the TA's name
- Click OK while the TA watches
- If you request propagation, it does not happen immediately, but should be posted in the next day or so
This demo box is for lab 2