Skip to content

Santhosh-Siddhardha/Dice-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dice-game

This is a simple web-based dice game implemented using HTML, CSS, and JavaScript. The game randomly rolls two dice whenever the page is refreshed, determines the outcome (whether Player 1 wins, Player 2 wins, or it's a draw), and displays the result on the screen.

How to Play

Setup:

  1. Ensure you have a modern web browser installed (such as Chrome, Firefox, or Safari).
  2. Clone or download this repository to your local machine.

Run the Game:

Run this link - https://santhosh-siddhardha.github.io/Dice-game/ (or) Open index.html in your web browser.

Playing the Game:

  • Upon loading the page, the game automatically rolls two dice.
  • The results will be displayed on the screen, showing the numbers rolled and the outcome (Player 1 wins, Player 2 wins, or Draw).
  • Refresh the page to play again and see new results.

Files Included

  • index.html: Main HTML file that displays the game interface.
  • style.css: CSS file for styling the game layout.
  • index.js: JavaScript file containing the game logic.
  • images folder: Contains the images of the dice.
  • README.md: This file, providing information about the game.

Game Logic

  • The game generates random numbers between 1 and 6 for two dice.
  • It compares the numbers rolled: If Player 1's dice roll is higher than Player 2's, Player 1 wins. If Player 2's dice roll is higher than Player 1's, Player 2 wins. If both players roll the same number, it's a draw.

Development

This game was developed using basic front-end web technologies (HTML, CSS, JavaScript) without any external libraries or frameworks. Feel free to explore the code and make modifications as needed.

Author

Lingamuneni Santhosh Siddhardha [email protected]

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published