test commit
This commit is contained in:
@@ -12,7 +12,7 @@ package com.bayviewglen.zork;
|
||||
*/
|
||||
class CommandWords {
|
||||
// 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.
|
||||
|
||||
@@ -142,6 +142,8 @@ class Game {
|
||||
printHelp();
|
||||
else if (commandWord.equals("go"))
|
||||
goRoom(command);
|
||||
else if (commandWord.equals("jump"))
|
||||
System.out.println("Good Job!");
|
||||
else if (commandWord.equals("quit")) {
|
||||
if (command.hasSecondWord())
|
||||
System.out.println("Quit what?");
|
||||
|
||||
Reference in New Issue
Block a user