├── dcg.png ├── .DS_Store ├── dice1.png ├── dice2.png ├── dice3.png ├── dice4.png ├── dice5.png ├── dice6.png ├── indes.js ├── README.md ├── index.html └── styles.css /dcg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dcg.png -------------------------------------------------------------------------------- /.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/.DS_Store -------------------------------------------------------------------------------- /dice1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice1.png -------------------------------------------------------------------------------- /dice2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice2.png -------------------------------------------------------------------------------- /dice3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice3.png -------------------------------------------------------------------------------- /dice4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice4.png -------------------------------------------------------------------------------- /dice5.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice5.png -------------------------------------------------------------------------------- /dice6.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/mahekar001aditya/Dice_Game/HEAD/dice6.png -------------------------------------------------------------------------------- /indes.js: -------------------------------------------------------------------------------- 1 | var randNum = Math.floor(Math.random()*6)+1; 2 | var randomDice ="dice" + randNum + ".png"; 3 | var imgg1 = document.querySelectorAll("img")[0]; 4 | imgg1.setAttribute("src",randomDice); 5 | 6 | var randNum2= Math.floor(Math.random()*6)+1; 7 | var randomDice2="dice" + randNum2+ ".png"; 8 | var imgg2 = document.querySelectorAll("img")[1]; 9 | imgg2.setAttribute("src",randomDice2); 10 | 11 | if(randNum > randNum2){ 12 | document.querySelector("h1").innerHTML = "Player 1 Wins"; 13 | } 14 | else if(randNum2 > randNum){ 15 | document.querySelector("h1").innerHTML = "Player 2 Wins"; 16 | } 17 | else{ 18 | document.querySelector("h1").innerHTML = "Match Draw!"; 19 | 20 | } 21 | 22 | 23 | 24 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # 🎲 Dice Game 2 | 3 | A fun and interactive **Dice Game** built using HTML, CSS, and JavaScript. 4 | The game simulates a two-player dice roll and displays the winner dynamically with visuals. 5 | 6 | --- 7 | 8 | ## 🌐 Live Demo 9 | 🔗 [Dice Game](https://adityamahekar.github.io/Dice_Game/) 10 | 11 | --- 12 | 13 | ## 🚀 Features 14 | - 🎲 Simulates rolling two dice 15 | - 👥 Two-player mode 16 | - 🖼️ Dice images change based on random outcome 17 | - ⚡ Fast and responsive interactions 18 | - 🧠 Simple logic with randomization 19 | 20 | --- 21 | 22 | ## 🛠️ Tech Stack 23 | - **Frontend**: HTML, CSS, JavaScript 24 | - **Deployment**: GitHub Pages 25 | 26 | --- 27 | 28 | ## 📷 Gallery 29 | 30 | | Dice Game UI | 31 | |--------------| 32 | |  | 33 | 34 | --- 35 | 36 | 37 | -------------------------------------------------------------------------------- /index.html: -------------------------------------------------------------------------------- 1 | 2 | 3 |
4 | 5 |Player 1
19 |
20 | Player 2
24 |
25 |