Git Product home page Git Product logo

chance's Introduction

Inspiration for the game:

I had the opportunity to live and work in Vegas for a few years. It was great fun! But one thing I soon learned was that most Casino games (slot machines etc.) favor the house, with the exception of a few. So, I wanted to create a game of chance between 2 or more players that truly is a game of chance, with no favoratism for the House. The game is designed to be completely random and illustrate the randomness of the outcomes. Dice outcomes get assigned completely random numbers. After multiple rounds have been played one should expect to see a completely random pattern of winners.

How to play the game:

Players get prompted for their names and choose the number of rounds they wish to play. Each player starts with a wallet of $1,000. Players place bets for each round of play. The bets get reflected in the pot. Players simultaneousy roll a pair of dice, and the player with the highest roll for the round wins the round and the pot. In the event of a tie roll, the players roll again. The player with the most winnings at the end of the designated number of rounds wins the game. If a player goes broke before the designated number of rounds is met, then the game is over.

Game Controls:

  1. Start New Game button - a new game is initiated by clicking this button. Players are then prompted for their names and the number of rounds they wish to play.

  2. Place Bets for Round button - Players then click this button to be prompted for their bet for the round. The pot reflects the bets and players' wallets get adjusted.

  3. Roll the Dice - players then click this button to simultsneously roll a pair of dice. The player with the highest roll wins the round and the pot. In the event of a tie roll the players roll again. The players' wallets get adjusted to reflect the outcome. Players then click on the "Place Bets for Round" button to begin the next round.

Technologies used to build the game: please note links to references/sources of code below are footnoted in the code comments.

  • HTML
  • Javascript
  • CSS
  • VS Code
  • Github
  • Chrome web browser
  • Google Search Engine

Unfinished functionality/outststanding bugs:

  • Total score and winner tracker.
  • Tracking bets from round to round (same as above).
  • Input parameters for bets (players must not be able to place bets for more than their current wallet).
  • Start New Game Button - clear cache and values for new game. Currently the browser page must be refreshed to clear values of current game and start a new game.
  • Styling - Players currently get displyed vertically and are to be shown horizontally. Layout also is being adjusted for easier viewing.
  • Special effects - sound of dice rolling, other effects still needs to be installed.
  • Dice need to be placed/referenced in the assets folder - correct path adjusted.
  • Style.css needs to be cleaned up. Currently contains sandbox code that is not used.

chance's People

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.