Advertisement
Guest User

Hangman

a guest
Feb 22nd, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.72 KB | None | 0 0
  1. while (hangman.gameOn()) {
  2.             System.out.println("Type a command: ");
  3.             String command = reader.nextLine();
  4.            
  5.             if (command == "quit") {
  6.                 break;
  7.             } else if (command == "status") {
  8.                 hangman.printStatus();
  9.             } else if (command.length() == 1) {
  10.                 hangman.guess(command);
  11.             } else if (command.isEmpty()) {
  12.                 System.out.println("String was empty");
  13.             } else {
  14.                 System.out.println("I found something!");
  15.             }
  16.            
  17.             hangman.printMan();
  18.             hangman.printWord();
  19.        
  20.         }
  21.          System.out.println("Thank you for playing!");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement