Simple Strategy for Three-Pile Nim
The simple strategy from two-pile Nim can be extended for three-pile Nim:
- If pile 1 is not empty, then remove one coin from pile 1;
- otherwise if pile 2 is not empty, then remove one coin from pile 2;
- otherwise remove one coin from pile 3.
Extend your simple-strategy procedure to reflect this.
Modify the nim procedure to replace the use
of intelligent-strategy-2-pile with the 3-pile simple-strategy.
Now run nim to
test your 3-pile Nim program. It should work similar to before, albeit with an
unintelligent strategy. Note that all input validation should also work
correctly.