Parsing - nt314p/Zork GitHub Wiki

  1. Extract main command word, 2 objects
  2. Run command on object 1, pass in object 2
  3. If doesn't work, run command on object 2, pass in object 1
  4. Recieve string result, print it

Run in classes --> Player, character, game, door

Not enough params --> "Please be more specific" Not a command --> "This is not a command. Press 'c' to view commands"

Command Words

String[ArrayList] params ArrayList[i].get(0) --> main command word ArrayList[i].get(j) --> synonyms

  • will cycle through all and return closest match (run on the main command word)

Interface of commands

  • List of all the commands that must be implemented (ex. playerCommands, gameCommands, doorCommands)
  • All commands return a string
  • All main command words are in the interface
⚠️ **GitHub.com Fallback** ⚠️