A fun, interactive command-line slot machine game built with JavaScript. Test your luck and try to win big!
- 💰 Deposit money and place bets
- 🎰 Spin the reels with 3 columns and 3 rows
- 🎲 Four different symbols (A, B, C, D) with different win multipliers
- 🏆 Win by matching symbols across selected lines
- 🔄 Play multiple rounds until you run out of money
- ✅ Input validation for all user entries
- Node.js (v12 or higher)
- Clone the repository:
git clone https://github.com/KinJonathan/slotMachineJavaScriptProject.git
cd slotMachineJavaScriptProject- Install dependencies:
npm installRun the game with:
node project.js- Deposit Money - Start by entering your initial deposit amount
- Select Lines - Choose how many lines to bet on (1-3)
- Place Bet - Enter your bet amount per line
- Spin - The reels spin automatically
- Win - Match symbols across your selected lines to win
- Repeat - Play again or cash out
| Symbol | Win Multiplier |
|---|---|
| A | 5x |
| B | 4x |
| C | 3x |
| D | 2x |
- Winnings = Bet Amount × Symbol Multiplier × Number of Matching Lines
You have a balance of $100
Enter the number of lines to bet on (1-3): 3
Enter the total bet per line: 10
============
Spin Results
============
A | B | C
D | A | B
C | D | A
You won, $0
Do you want to play again (y/n)?
slotMachineJavaScriptProject/
├── project.js # Main game file
├── package.json # Project dependencies
└── README.md # This file
- prompt-sync (^4.2.0) - For handling user input in the terminal
ISC
Feel free to fork this project and submit pull requests for any improvements!
Good luck at the tables!