ShubhamAdelkar / slot-machine-js

This project is a Node.js-based command-line slot machine game that lets users deposit money, select the number of lines to bet on, and spin the reels for a chance to win virtual currency.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript Slot Machine Game

Overview

This project is a command-line-based slot machine game written in JavaScript. The game faithfully simulates the experience of playing a classic slot machine. Players can deposit an initial amount of money, select the number of lines to bet on, and then spin the reels in hopes of winning virtual currency. Key components include functions for depositing money, placing bets, simulating reel spins, determining winning combinations, awarding winnings, and allowing players to continue playing.

Key Components

1. Deposit Function:
Users can deposit an initial amount of money, ensuring it's a valid positive number.

2. Number of Lines Selection:
Players can choose the number of lines to bet on (1-3).

3. Bet Placement:
Users can place bets on each line, ensuring they don't exceed their available balance.

4. Reel Spinning:
The game simulates spinning the reels, featuring various symbols (A, B, C, D) with different counts.

5. Winning Calculation:
The game checks for winning combinations and calculates winnings based on the selected lines and the values of the symbols.

6. Balance Tracking:
Players' balances are updated as they play and win.

7. Play Again Option:
After each game round, players can choose to continue or exit the game.

How to Play

  1. Run the Game:
    Execute the JavaScript file in a compatible environment.

  2. Deposit Money:
    Upon starting, you'll be prompted to deposit an initial amount of money.

  3. Select Number of Lines:
    Choose the number of lines to bet on (between 1 and 3).

  4. Place Bets:
    Place bets on each line while ensuring the total bet amount does not exceed your available balance.

  5. Spin the Reels:
    Initiate the game by spinning the reels, revealing random symbol combinations.

  6. Check for Winnings:
    The game automatically checks for winning combinations and displays your winnings.

  7. Update Your Balance:
    Your balance is adjusted based on the results of the game.

  8. Play Again:
    After each game round, you have the option to continue playing or exit the game.

Winning Combinations

  • Matching symbols on a line lead to winnings.
  • The value of the symbols (A, B, C, D) determines the amount won.
  • Betting on more lines increases your chances of winning.

Enjoy your gaming experience with the JavaScript Slot Machine Game!

About

This project is a Node.js-based command-line slot machine game that lets users deposit money, select the number of lines to bet on, and spin the reels for a chance to win virtual currency.


Languages

Language:JavaScript 100.0%