Skip to content

KinJonathan/slotMachineJavaScriptProject

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slot Machine Game

A fun, interactive command-line slot machine game built with JavaScript. Test your luck and try to win big!

Features

  • 💰 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

Installation

Prerequisites

  • Node.js (v12 or higher)

Steps

  1. Clone the repository:
git clone https://github.com/KinJonathan/slotMachineJavaScriptProject.git
cd slotMachineJavaScriptProject
  1. Install dependencies:
npm install

How to Play

Run the game with:

node project.js

Game Rules

  1. Deposit Money - Start by entering your initial deposit amount
  2. Select Lines - Choose how many lines to bet on (1-3)
  3. Place Bet - Enter your bet amount per line
  4. Spin - The reels spin automatically
  5. Win - Match symbols across your selected lines to win
  6. Repeat - Play again or cash out

Symbol Values

Symbol Win Multiplier
A 5x
B 4x
C 3x
D 2x

Winnings Calculation

  • Winnings = Bet Amount × Symbol Multiplier × Number of Matching Lines

Example Gameplay

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)?

Project Structure

slotMachineJavaScriptProject/
├── project.js       # Main game file
├── package.json     # Project dependencies
└── README.md        # This file

Dependencies

  • prompt-sync (^4.2.0) - For handling user input in the terminal

License

ISC

Contributing

Feel free to fork this project and submit pull requests for any improvements!

Have Fun! 🎰

Good luck at the tables!

About

Simple JavaScript command-line slot machine game with betting, reels, and win multipliers

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

No releases published

Packages

 
 
 

Contributors