aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/esieequest/CommandWords.java10
-rw-r--r--src/esieequest/Game.java2
-rw-r--r--src/esieequest/Parser.java7
3 files changed, 18 insertions, 1 deletions
diff --git a/src/esieequest/CommandWords.java b/src/esieequest/CommandWords.java
index de1d132..a0718e3 100644
--- a/src/esieequest/CommandWords.java
+++ b/src/esieequest/CommandWords.java
@@ -31,4 +31,14 @@ public class CommandWords {
31 } 31 }
32 return false; 32 return false;
33 } 33 }
34
35 /**
36 * Print all valid commands to System.out.
37 */
38 public void showAll() {
39 for (String vCommand : this.sValidCommands) {
40 System.out.print(vCommand + " ");
41 }
42 System.out.println();
43 }
34} 44}
diff --git a/src/esieequest/Game.java b/src/esieequest/Game.java
index 49ff765..ece1bcc 100644
--- a/src/esieequest/Game.java
+++ b/src/esieequest/Game.java
@@ -219,7 +219,7 @@ public class Game {
219 System.out.println("You wander around at the university."); 219 System.out.println("You wander around at the university.");
220 System.out.println(""); 220 System.out.println("");
221 System.out.println("Your command words are:"); 221 System.out.println("Your command words are:");
222 System.out.println(" go quit help"); 222 this.aParser.showCommands();
223 } 223 }
224 224
225 private void look() { 225 private void look() {
diff --git a/src/esieequest/Parser.java b/src/esieequest/Parser.java
index 08f2bca..cc3ff11 100644
--- a/src/esieequest/Parser.java
+++ b/src/esieequest/Parser.java
@@ -55,4 +55,11 @@ public class Parser {
55 return new Command(null, null); 55 return new Command(null, null);
56 } 56 }
57 } 57 }
58
59 /**
60 * Print out a list of valid command words.
61 */
62 public void showCommands() {
63 this.aValidCommands.showAll();
64 }
58} 65}