All pastes #761373 Raw Edit

Miscellany

public text v1 · immutable
·published 2007-11-04 20:47 UTC
rendered paste body
public void go()
    {
        Player player1 = new Player();
        Player player2 = new Player();
        Scanner scanIn = new Scanner (System.in);
        int validInput = 0;
        
        System.out.println("Would you like to play a game of " + 
            "rock, paper, scissors?");

        String response = scanIn.nextLine();
        
        while (validInput == 0)
        {
            if (response.equals("yes"))
            {
                //playGame();
                validInput = 1;
            }
            else if (response.equals("no"))
            {
                quit();
                validInput = 1;
            }
            else
            {
                System.out.println("Please enter yes or no only.");
            }
        }
    }