This is an interactive slot machine. The user has to click the Spin button in hopes of getting three 2's. If the user gets three 2's, a message is displayed.
For all three numbers, the state is initialized to 0. There is a random number generator that selects numbers 1 - 2. Each time the click event happens, the state for all three numbers is changed. Once the user gets all three 2's, the game is over and the Spin button changes to a Play Again button. Also, once the user wins, the background colors change to random colors.
✔️ React
✔️ Node Package Manager (NPM)
✔️ Bootstrap
- Add instructions for the game - put above the container that holds the game
- B.01: Write code to remove the
<button>
and replace it with a message for the winner - B.02: Figure out why the background isn't changing when the user wins
- B.03: If the user clicks the Play Again button, have the state to return to the initial state
- F.01: Change background color to random colors when a user wins
-
F.02: Display winner's message in a pop-up modal - F.03: Add a play again button
Just My Luck
A Gabe A. Production