Untitled

Run Settings
LanguageJava
Language Version
Run Command
class DiceGame { public static void main (String{} args) { int d1p1=(int)Math.ceil(Math.random()*6); int d2p1=(int)Math.ceil(Math.random()*6); int d1p2=(int)Math.ceil(Math.random()*6); int d2p2=(int)Math.ceil(Math.random()*6); int player1=0; int player2=0; System.out.println("player 1\t\t\t\tPlayer 2\n----------\t\t\t\t----------\n"); while(player1<=100 && player2 <=100) { d1p1=(int)Math.ceil(Math.random()*6); d2p1=(int)Math.ceil(Math.random()*6); d1p2=(int)Math.ceil(Math.random()*6); d2p2=(int)Math.ceil(Math.random()*6); player1+=d1p1+d2p1; player2+=d1p2+d2p2; System.out.println("["+d1p1+"]"+"["+d2p1+"] "+player1+" \t\t\t\t"+"["+d1p2+"]"+"["+d2p2+"] "+player2); if(player1>=100) { System.out.println("Player 1 wins!"); System.out.println("Please play again!"); } else if (player2>=100) { System.out.println("\t\t\t\t\tPlayer 2 wins!"); System.out.println("\t\t\t\t\tPlease play again!"); } } }
Editor Settings
Theme
Key bindings
Full width
Lines