Outlab

Due next lab class.

The Game of NIM

This lab is to work on your problem solving skills. It covers material from the whole semester, pick the correct data types, structures, objects and programming rules to solve the problem. Next week after you turn in the lab I will post an answer so you can compare your code with my code.

This is a well known game with little tricks.
The game is played with two players alternately take marbles from a pile. In each move, a player chooses how many marbles to take. The player must take at least one but at most half of the marbles. Then the other players takes a turn. The player who takes the last marble loses.

Write a program in which the computer plays against a human opponent.

See if you can beat the computer if it goes first, if you programmed it correctly you can't.

Grading

This will be graded on the program working, by allowing a human player to play against the computer following the rules and a winner is decided.
Proper programming skills, good clear variable definitions, good class structure, and the proper use of methods will all be graded. As well as properly commented code.

Turn in

Your program will be due at the beginning of your next lab class. No late assignments will be accepted. Turn in what you get done if you don't finish it. All assignments should be turned in to your lab TA.