/** * This class contains the beginning of a text adventure game. * * @author COMP 1711 Instructors * @version October 2003 */ import java.io.*; public class TextGame { public void playGame() throws IOException { InputStreamReader isr = new InputStreamReader(System.in); BufferedReader br = new BufferedReader(isr); String input; System.out.print("Enter the password: "); input = br.readLine(); while (!input.equals("swordfish")) { System.out.println(" *** INCORRECT PASSWORD!!! ***"); System.out.print("Please try again: "); input = br.readLine(); } System.out.println(); System.out.println("Welcome to a World of Adventure!!"); System.out.println(); System.out.println("You are in a clearing in the woods."); System.out.println("To the north is a castle..."); } // end playGame() } // end class TextGame