Slot Machine
A player can insert any number of tokens into the machine. Once the there are tokens in the machine, the player can make a bet. The player can bet 1, 2, or 3 tokens. Once they press Enter, three random numbers appear representing the slots on the slot machine with a range of 5 numbers. The player wins by getting all of the same random number. If they win, they win tokens and that is added to are added to their amount. If the player loses, they lose the amount that they bet.
The algorithm for winning tokens is as follows: The number they rolled to the power of the number they bet.
So if they rolled all 2's and they bet 3 tokens, it would be 2 to the power of 3: or 8 tokens.
Sample session:
Murph E Cheese Slot Machine
Enter the starting number of tokens you wish to use: 10
How much do you wish to bet? (4 to cash out): 3
[3] [5] [1]
You lose 3 tokens
Tokens: 7
How much do you wish to bet? (4 to cash out): 2
[3] [3] [3]
You win 9 tokens
Tokens: 16
How much do you wish to bet? (4 to cash out): 4
You receive 16 tokens
Thanks for playing