Commits

Brandon Rhodes committed cd38525

Adjusted game vocabulary to accept the old 5-letter command abbreviations.

Comments (0)

Files changed (1)

adventure/game.py

 
     def start(self):
         """Start the game."""
+
+        # For old-fashioned players, accept five-letter truncations like
+        # "inven" instead of insisting on full words like "inventory".
+
+        for key, value in list(self.vocabulary.items()):
+            if isinstance(key, str) and len(key) > 5:
+                self.vocabulary[key[:5]] = value
+
+        # Set things going.
+
         self.chest_room = self.rooms[114]
         self.bottle.contents = self.water
         self.yesno(self.messages[65], self.start2)  # want instructions?