import java.util.Scanner; /** First attempt at writing a hangman/wheel of fortune game. */ public class Driver { public static void main(String [] args) { // set up the game Game game = new Game(); Scanner kbd = new Scanner(System.in); while (true) { // Print current status of game and prompt user. System.out.printf("\n%s\n", game.toString()); System.out.printf("Enter a letter: "); char choice = kbd.nextLine().charAt(0); // See if our choice is good. game.play(choice); if (game.win()) { System.out.printf("You win!\n"); break; } else if (game.lose()) { System.out.printf("Sorry, you lose!\n"); System.out.printf("The answer is %s\n", game.getAnswer()); break; } } } }