Coder Social home page Coder Social logo

codingaslu / slot-machine-game Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 961 KB

This is a simple command-line-based slot machine game built with JavaScript. Players deposit money and choose the number of lines to bet on and the bet amount. The game spins the reels and displays the results, awarding winnings if the player wins. The game continues until the player runs out of money or chooses to quit.

JavaScript 100.00%
javascript

slot-machine-game's Introduction

Slot Machine Game Readme

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:

  1. Deposit some money
  2. Determine the number of lines to bet on
  3. Collect a bet amount
  4. Spin the slot machine
  5. Check if the user won
  6. Give the user their winnings
  7. Play again

How to run the game

  1. Clone the repository to your local machine.
  2. Open the command prompt or terminal and navigate to the project directory.
  3. To install 'prompt-sync' module run the command: npm install prompt-sync
  4. Run the command node slot-machine.js to start the game.
  5. Follow the instructions on the screen to play the game.

Game rules

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

Acknowledgments

This game was developed as a learning exercise and is based on the "Slot Machine" exercise in the book "Eloquent JavaScript" by Marijn Haverbeke.

slot-machine-game's People

Contributors

codingaslu avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.