Hi i've been set this assignment to design a Craps game for Java, i know this has been done lots before but i seem to be going round and round with this code....very frustrating!
This is the code i've written so far:
public class CrapsGame {
public static void main(String[] args) {
int die1 = (int) (Math.random()*6 + 1);
int die2 = (int) (Math.random()*6 + 1);
int dice = die1 + die2;
System.out.println("You rolled " + dice);
if (dice == 7 || dice == 11){
System.out.println("We have a winner");
}
else if (dice == 2 || dice == 3 || dice == 12){
System.out.println("CRAPS!");
}
else {
System.out.println("Marker is "+dice);
int die3 = (int) (Math.random()*6 + 1);
int die4 = (int) (Math.random()*6 + 1);
int dice2 = die3 + die4;
while(dice2 != dice || dice2 != 7){
System.out.println("You rolled "+dice2);
}
} //Else
} //Main
} //Class
I'm very aware this isnt the finished article at all but any help would be greatly appreciated!