This commit is contained in:
2025-02-18 13:53:59 +01:00
parent e64a127c34
commit a7344d4543
3 changed files with 23 additions and 2 deletions

View File

@@ -15,7 +15,7 @@ public class CommandWords
{
// a constant array that holds all valid command words
private static final String[] validCommands = {
"go", "quit", "help"
"go", "quit", "help", "look"
};
/**
@@ -40,4 +40,14 @@ public class CommandWords
// if we get here, the string was not found in the commands
return false;
}
public String showAll()
{
StringBuilder exitsInString = new StringBuilder();
for (String validCommands : validCommands){
exitsInString.append(validCommands).append(" ");
}
return exitsInString.toString().trim();
}
}