Z-Machine

exception textworld.envs.zmachine.jericho.JerichoUnsupportedGameWarning[source]

Bases: UserWarning

class textworld.envs.zmachine.jericho.JerichoEnv(*args, **kwargs)[source]

Bases: textworld.core.Environment

Arguments: infos: Information to be included in the game state. By

default, only the game’s narrative is included.

close()[source]

Ends the game.

load(z_file)[source]

Loads a new text-based game.

Parameters

path – Path to the game file to load.

Return type

None

reset()[source]

Starts game from the beginning.

Returns

Initial state of the game.

seed(seed=None)[source]

Sets the seed for the random number generator.

step(command)[source]

Performs a given command.

Parameters

command – Text command to send to the interpreter.

Returns

A tuple containing the new game state, a reward for performing that command and reaching this new state, and whether the game is finished or not.

property game_running

Determines if the game is still running.

Return type

bool