the dice game

Run Settings
LanguageJava
Language Version
Run Command
class DiceGame { public static void main(String[] args) { System.out.println("dice game"); System.out.println("player1\t\t\tplayer2"); double p1t =0; double p2t =0; while(p1t <100 && p2t <100) { double randD1 = (Math.round((Math.random() * (6 - 1)) + 1 )); double randD2 = (Math.round((Math.random() * (6 - 1)) + 1 )); p1t += randD1 + randD2; double randD3 = (Math.round((Math.random() * (6 - 1)) + 1 )); double randD4 = (Math.round((Math.random() * (6 - 1)) + 1 )); p2t += randD3 + randD4; System.out.println(randD1 +"\t"+ randD2 + "\t" + p1t +" |\t"+randD3 +"\t"+ randD4 + "\t" + p2t); } if (p1t >= 100){System.out.println("player 1 wins!");} else {System.out.println("player 2 wins!");} } }
Editor Settings
Theme
Key bindings
Full width
Lines