test commit
This commit is contained in:
@@ -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.
|
||||||
|
|||||||
@@ -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?");
|
||||||
|
|||||||
Reference in New Issue
Block a user