This assignment will help you learn about game tree search.
In class we drew the game tree for a version of chips called "last wins". The first player can take between 1 and n-1 of the chips, and on subsequent moves the play can take between 1 and twice the number of chips that his opponent took on the previous move. The winner is the player who takes the last chip.
The Chips program that we saw in class played a different version, "even wins". I said that the even-wins Chips program could be changed to last wins by changing a few things in theGame
class. Specifically:
maxMove
from chips/2
to chips-1
in the constructorgetWinner
to use the new rule for deciding the winnerinputInitChips
method to not require the number of chips to be odd.Everything else is unchanged!
Make these changes to the code inGames.java
in the Chips program, which can be
downloaded here: Chips.zip.
Invent and implement other interesting variations on Chips. The variations "last looses" and "even looses" (or odd wins) are not different enough to be interesting.
Submit a file via Canvas that contains your version of Game.java
and a run to demonstrate that it works correctly.