MS 4: Action Verbs: TAKE, DROP, and INVENTORY

The next step is to add the TAKE, DROP, and INVENTORY action verbs to the command processor you implemented for Milestone 2. The TAKE verb checks to see if an item is in the room, and if so, removes it from the room and adds it to the player’s inventory. The DROP verb reverses the process, removing an item from the player’s inventory and then adding that item to the room. The INVENTORY verb goes through the player’s inventory and prints the description of each item. If the player’s inventory is empty, the INVENTORY command should display the string "You are empty-handed.". These behaviors are illustrated in the following sample run from the beginning of the game:

Implementing this milestone requires several steps: