All pastes #254308 Raw Edit

Miscellany

public text v1 · immutable
#254308 ·published 2006-11-21 18:44 UTC
rendered paste body
 while ( gameStatus == Status.CONTINUE ) // not WON or LOST
        {
           sumOfDice = rollDice(); // roll dice again

           // determine game status
           if ( sumOfDice == myPoint ) // win by making point
              gameStatus = Status.WON;
           else
              if ( sumOfDice == SEVEN ) // lose by rolling 7 before point
                 gameStatus = Status.LOST;
        } // end while

        // display won or lost message
        if ( gameStatus == Status.WON )
           System.out.println( "Player wins" );
        else
           System.out.println( "Player loses" );