/** * This program will play a simple word scramble game with the user. * * @author Anthony Larrain */ import javax.swing.JOptionPane; import java.util.Scanner; class WordGameA{ public static void main(String[] args){ String guess; WordList list = new WordList(); Scanner input = new Scanner(System.in); while(true){ list.pickWord(); System.out.print("Take a Guess (or type quit) " + list.scramble() + "\t>>>>> "); guess = input.nextLine(); guess = guess.trim().toLowerCase(); if(guess.equals("quit")){ break; } if(guess.equals(list.getWord())){ System.out.println("Correct, I'm so proud of you"); }else{ System.out.println("Sorry, correct word is ... " + list.getWord()); } System.out.println(); } System.out.println("Good Bye, thanks for playing"); } }