Skip to content

Sada75/Slot-Machine-Simulator-using-JavaScript-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SLOT MACHINE SIMULATOR

This is a simple slot machine game implemented in JavaScript. The game allows users to deposit money, place bets on multiple lines, spin the slot machine, and check their winnings. Users can choose to play again or quit based on their balance.

Features

Deposit money to start playing.
Choose the number of lines to bet on (1-3).
Place bets per line.
Spin the slot machine to get random symbols.
Check if you have won and get your winnings.
Option to play again or quit.

INSTALLATION :

1. Clone the repository: git clone https://github.com/your-username/slot-machine-game.git
  1. Navigate to the project directory: cd slot-machine-game

  2. Install the required dependencies: npm install

  3. Also set up Node.js

USAGE :

To run the slot machine game, use the following command: node project.js

CODE STRUCTURE :

1. deposit: Function to deposit money.
2. getNumberofLines: Function to get the number of lines to bet on.
3. getBet: Function to get the bet amount per line.
4. spin: Function to spin the slot machine and get random symbols.
5. transpose: Function to transpose the reels for easy checking of lines.
6. printRow: Function to print the rows of the slot machine.
7. getWinnings: Function to calculate the winnings based on the bet and lines.

EXAMPLE :

Enter the deposit amount: 100
Enter the number of lines which you want to bet on (1-3): 2
Enter the bet amount per line: 10
A|B|C
D|A|B
C|D|A
You won $20
You are left with $110
You want to play again? (y/n): y
...

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors