In the game of Nim, you have three piles of five stones. During each turn, each player can remove any number of stones from a single pile (a player cannot take stones from more than one pile). The player who removes the last stone from all of the heaps wins.
Here is a sample game:
|Pile A||Pile B||Pile C||Action|
|2||5||5||Alice removes 3 stones from Pile A|
|2||5||0||Bob removes 5 stones from Pile C|
|2||1||0||Alice removes 4 stones from Pile B|
|2||0||0||Bob removes 1 stone from Pile B|
|2||0||0||Alice removes 2 stones from Pile A and wins!|
The computer should make smart decisions. For example, if the computer can win in a turn then the computer should make the winning move.
Draw the current state of the piles after each turn. Use console.log() to draw the piles:
Pile A: ooooo Pile B: ooo Pile C: ooooo