zoro-diablo / Js-Dice

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

JavaScript Dice Game

Welcome to the JavaScript Dice Game! This website allows you to play a fun and exciting dice game against the computer. The objective of the game is to be the first player to reach a score of 100.

About

The JavaScript Dice Game is a web-based game built using HTML, CSS, and JavaScript. It simulates the rolling of dice and tracks the scores of both the player and the computer. The game follows the traditional rules, where each player takes turns rolling the dice and accumulating points. The first player to reach a score of 100 wins the game.

How to Play

  1. Visit the live site: https://zoro-diablo.github.io/Js-Dice/

  2. The game starts with the player's turn. Click the "Roll Dice" button to roll the dice and see your score increase. The number on the dice will be added to your current score.

  3. You can continue rolling the dice as many times as you want during your turn. However, if you roll a "1", your turn ends, and your current score is reset to zero. It will then be the computer's turn.

  4. The computer will automatically roll the dice and accumulate points. The computer will keep rolling until it reaches a score of at least 20 or rolls a "1", which ends its turn.

  5. The game continues with alternating turns between the player and the computer. The scores are updated after each turn.

  6. The first player to reach a score of 100 wins the game. A congratulatory message will be displayed, and you can choose to play again by clicking the "New Game" button.

Development

If you're interested in contributing to the JavaScript Dice Game or exploring its source code, follow these steps:

  1. Clone the repository:

About


Languages

Language:CSS 41.1%Language:JavaScript 40.4%Language:HTML 18.5%