test commit

This commit is contained in:
jslightham
2019-01-16 10:15:27 -05:00
parent 73dabdaef6
commit 383b4500ef
2 changed files with 3 additions and 1 deletions

View File

@@ -12,7 +12,7 @@ package com.bayviewglen.zork;
*/ */
class CommandWords { class CommandWords {
// a constant array that holds all valid command words // a constant array that holds all valid command words
private static final String validCommands[] = { "go", "quit", "help", "eat" }; private static final String validCommands[] = { "go", "quit", "help", "eat", "jump" };
/** /**
* Constructor - initialise the command words. * Constructor - initialise the command words.

View File

@@ -142,6 +142,8 @@ class Game {
printHelp(); printHelp();
else if (commandWord.equals("go")) else if (commandWord.equals("go"))
goRoom(command); goRoom(command);
else if (commandWord.equals("jump"))
System.out.println("Good Job!");
else if (commandWord.equals("quit")) { else if (commandWord.equals("quit")) {
if (command.hasSecondWord()) if (command.hasSecondWord())
System.out.println("Quit what?"); System.out.println("Quit what?");