# C++: Programming Problem - Game to remove tokens

## Description of game

There two-person game starts by placing about 20 tokens (coins, cards, stones, ...) on the table. The players take turns removing either one, two, or three tokens on each turn. The loser is the player who is forced to take the last token.

## Program

Write a program to play this game against a human.

You should use incremental programming techniques, which means that you should start with a very small working program, and make improvements to it in small steps that you test each time. For example,

1. First write a program that simply prints out instructions.
2. Then modifiy it to print a starting number (eg, 20) with a loop reading numbers from the human opponent.
3. Next add checking to see if they entered a legal number (1-3).
4. Next subtract their entry from the total number of tokens and terminate the loop when the number of tokens is zero.
5. Calculate a response to the user's input so your program plays against them.

Maybe these aren't exactly the steps that you want to use, but this style of incremental development is very, very successful. Also it should always leave you with a running, but possibly incomplete, program - the version before the last increment.

## Improvements

1. Randomize the initial value.
2. Figure out how to play optimally, and make random moves when that isn't possible.
3. Let the user choose to go first or second.
4. Etc.

## References

Random Numbers.