I need the code for the Craps Game it is urgentSolutionsimpl
I need the code for the Craps Game, it is urgent
Solution
simple java code for craps game
public class CrapsGame {
public static void main(String[] args
{
int dice1 = (int)(Math.random()* 6) + 1;
int dice2 = (int)(Math.random()* 6) + 1;
int roll = dice1 + dice2;
System.out.println();
System.out.print(\"You rolled \"+roll+\". \");
if(roll == 2 || roll == 3 || roll == 12;
{
System.out.println(\"You Lose !\");
}
else if(roll == 7 || roll == 11
{
System.out.println(\"You Win !\");
}
else{
System.out.println(\"Point is \"+roll+\"\ \");
dice1 = (int)(Math.random()* 6) + 1;
dice2 = (int)(Math.random()* 6) + 1;
int roll2 = dice1 + dice2;
System.out.print(\"You rolled \"+roll2+\". \");
while(roll2 != 7){
if(roll == roll2){
System.out.println(\"You Win !\");
break;
}
Else
{
System.out.println(\"Point is \"+roll+\"\ \");
}
dice1 = (int)(Math.random()* 6) + 1;
dice2 = (int)(Math.random()* 6) + 1;
roll2 = dice1 + dice2;
System.out.print(\"You rolled \"+roll2+\". \");
}
if(roll2 == 7)
{
System.out.println(\"You Lose !\");
}
}
}
}
![I need the code for the Craps Game, it is urgentSolutionsimple java code for craps game public class CrapsGame { public static void main(String[] args { int dic I need the code for the Craps Game, it is urgentSolutionsimple java code for craps game public class CrapsGame { public static void main(String[] args { int dic](/WebImages/1/i-need-the-code-for-the-craps-game-it-is-urgentsolutionsimpl-965579-1761494853-0.webp)