Code Monkey home page Code Monkey logo

dice-game-js's Introduction

Dice Game

A simple dice game where two players take turns rolling a dice to accumulate points. The objective is to be the first player to reach a score of 50.

Game Rules

  1. Player One always starts the game.
  2. Both players use the same "Roll Dice" button when it's their turn.
  3. To win the game, a player must roll the dice until they get a value other than 1.
  4. If a player rolls a 1, their turn ends, and it automatically becomes the other player's turn.
  5. Before rolling a 1, a player can choose to "Hold" their current score, which adds it to their total score. It becomes the other player's turn.
  6. Players continue taking turns, accumulating points by rolling the dice and holding their scores until one player reaches a score of 50.
  7. The first player to reach or exceed a score of 50 wins the game.

How to Play

https://onedice.netlify.app/

  1. Open the welcome.html file in a web browser.
  2. Player One (Player 1) starts the game with an initial score of 0.
  3. Click the "Roll Dice" button to roll the dice. The current score will be updated based on the dice roll.
  4. Keep rolling the dice or choose to "Hold" your current score.
  5. If you roll a 1, your turn ends, and it becomes the other player's turn.
  6. The game continues until one player reaches a score of 50.
  7. Once a player wins, a "WINNER" message will be displayed.

Technologies Used

  • HTML
  • CSS
  • JavaScript

File Structure

  • index.html: The welcoming page that displays the welcome interface.
  • game.html: The main HTML file that displays the game interface.
  • style.css: The CSS file that styles the game elements.
  • app.js: The JavaScript file that contains the game logic.

License

This project is licensed under the MIT License.

Feel free to explore, modify, and distribute this code as per the terms of the license.

dice-game-js's People

Contributors

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