Plugging in an Intelligent Strategy
Think about how to play three-pile Nim intelligently, that is, to force a win
when possible:
- Start by building on the winning strategy for two-pile Nim
and incorporating it into a strategy for three-pile Nim.
- Call your procedure intelligent-strategy-3-pile and describe its
approach in an informative comment preceding its definition.
- Modify the nim procedure to replace the use
of the 3-pile simple-strategy
with intelligent-strategy-3-pile.
- Now run nim to test your intelligent 3-pile Nim program.