Read: Read 5.4 (about for loops), Appendix A and Appendix D.
Program: Write a program which plays the game of Marienbad with the user.
Rules of the game
Your program should display the sticks at the start of each player's turn. The user goes first, and the computer responds with an automatically generated response. The computer understands when the game has been won or lost, and responds appropriately. The computer also understands illegal moves, and responds appropriately. Bad input should not crash the program.
For extra credit: The computer, since it plays second, has a winning strategy - it can always win. Find and implement this strategy.
Download an SGI compatible binary for an example solution. (You will have to do a SAVE LINK as filename Marienbad and then chmod u+x Marienbad to set run-ability on the saved file.)