Defines

jericho.defines.ILLEGAL_ACTIONS

List of illegal actions that manipulate game state.

jericho.defines.BASIC_ACTIONS = ['north', 'south', 'west', 'east', 'northwest', 'southwest', 'northeast', 'southeast', 'up', 'down', 'enter', 'exit', 'take all']

List of basic actions applicable to almost any game.

jericho.defines.NO_EFFECT_ACTIONS = ['examine', 'x', 'look', 'l', 'i', 'inventory', 'gaze']

List of actions that usually don’t change the world state.

jericho.defines.UNRECOGNIZED_REGEXPS

List of regular expressions meant to capture game responses that indicate the last action was unrecognized. This list covers most common paterns. However, some games like loose.z5 and lostpig.z8 write custom responses that may note be captured.

jericho.defines.ABBRV_DICT = {'d': 'down', 'e': 'east', 'g': 'again', 'i': 'inventory', 'l': 'look', 'n': 'north', 'ne': 'northeast', 'nw': 'northwest', 'q': 'quit', 's': 'south', 'se': 'southeast', 'sw': 'southwest', 't': 'talk', 'u': 'up', 'w': 'west', 'x': 'examine', 'y': 'yes', 'z': 'wait'}

The action abbreviation dictionary contains abbreviations of common actions.

class jericho.defines.TemplateAction(action, template_id, obj_ids)

A TemplateAction provides a class to bundle a textual action with the template_id and object_ids that generated the action.

Parameters:
  • action (string) – The action text.
  • template_id (int) – The numerical index of the template used to generate the action.
  • obj_ids (list) – List of vocabulary ids used to fill in the template.