This is a simple and interactive two-player dice game built using HTML, CSS, and JavaScript. It was developed as a homework assignment during a JavaScript learning course.
- The game is played between two players.
- Each player takes turns rolling the dice as many times as they wish during their turn.
- The rolled value gets added to the current score.
- At any moment, the player can choose to hold (save) their current score, which adds it to their total score and passes the turn to the other player.
- If a player rolls a
1, their current score is lost and the turn passes to the opponent. - The first player to reach 40 points or more is declared the winner.
- 🎮 Turn-based gameplay for 2 players
- 🎲 Dice rolling with random numbers (1–6)
- 💾 Score saving and accumulation
- 🔄 Switching turns automatically
- 🏆 Winning condition: first to 40 points
- 🎨 Simple and responsive UI
- HTML5 – Basic page structure
- CSS3 – Styling and layout
- JavaScript (Vanilla) – Game logic, dice roll, score tracking, and UI updates