Loading      Loading      Loading      Loading      Loading      Loading      Loading      Loading      Loading      
Loading      Loading      Loading      Loading      Loading      Loading      Loading      Loading      Loading      

04 / Dice Game

A java program that acts to simulate a dice game between two players where the players are acting as if they have two lives.
SoftwareS
Java
Duration
4 Hours

Background

The Java program simulates a two-player dice game with two lives each, randomly determining the starting player. In a while loop, it generates random numbers (1-6) for each player's turn, allowing the user to choose to reroll or continue. The program compares the dice sums, deducting a life from the player with the lower sum. Input is managed through Random and Scanner packages, and the game concludes when a player loses all lives, providing output with dice rolls and user prompts for continuous control.

Code & Output