All pastes #229953 Raw Edit

Unnamed

public text v1 · immutable
#229953 ·published 2006-10-31 01:05 UTC
rendered paste body
public void comeOut(){
   
    if (canComeOut()){  // if canComeOut() returns true
        die1.roll();    // roll the dice
        die2.roll();
        int val1 = die1.getValue(); // get the values of the
        int val2 = die2.getValue(); // dice
            point = (val1 + val2);  // add the two die to set point
            
    if((point == 7) || (point == 11)){ // if the user rolled a 7 ot 11
        message = "you rolled a " + point + " WINNER! "; // player wins
        credit = credit + 1;    // add a credit
        point = 0; // reset point to )
        
    }else if ((point == 2)  || (point == 3) || (point == 12) ){
        message = " you rolled a " + point + " you lost 1 credit =( ";
        credit = credit -1; // if user rolled a 2, 3 or 12
        point = 0;          // the player loses 
    }else{ // if the player cant "comeOut" 
        message = " your point is " + point + " roll now";
    }
    }
}