Skip to content

R-i-t-i-k-a/Dice-Game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

A simple web-based dice game that simulates a two-player dice roll and determines the winner.

Description

This project implements a simple dice game using HTML, CSS, and JavaScript. It generates random rolls for two players, displays their corresponding dice faces, and determines the winner or a tie based on the rolls.

Usage

  1. Open the dicee.html file in a web browser.
  2. Click the "Roll Dice" button to play the game.
  3. Observe the dice faces displayed for each player and the winner/tie result.

How It Works

  1. The Math.random() function is used to generate random numbers for both players' dice rolls.
  2. Corresponding dice face images are loaded based on the rolled numbers.
  3. The program compares the two rolls to determine the winner or if it's a tie.
  4. The result is displayed in the heading (<h1>) element.

Installation

There is no specific installation required. You can simply open the dicee.html file in a web browser to play the game.