This is a simple command-line slot machine game written in JavaScript. The game allows the user to deposit money, choose the number of lines to bet on, place a bet, spin the reels, and check if they won.
The game consists of the following steps:
- Deposit some money
- Determine the number of lines to bet on
- Collect a bet amount
- Spin the slot machine
- Check if the user won
- Give the user their winnings
- Play again
- Clone the repository to your local machine.
- Open the command prompt or terminal and navigate to the project directory.
- To install 'prompt-sync' module run the command: npm install prompt-sync
- Run the command
node slot-machine.js
to start the game. - Follow the instructions on the screen to play the game.
- The game consists of 3 reels and 3 rows of symbols.
- The player can choose to bet on 1, 2, or 3 lines.
- The symbols are represented by letters (A, B, C, D).
- Each symbol has a different value, and the payout is based on the value of the symbols and the bet amount.
- The player wins if all symbols on a line are the same.
- The game ends when the player runs out of money or chooses to quit.
This game was developed as a learning exercise and is based on the "Slot Machine" exercise in the book "Eloquent JavaScript" by Marijn Haverbeke.