Z-Machine

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

Bases: Environment

Parameters:

request_infos – Information to be included in the game state. By default, only the game’s narrative is included.

close()[source]

Ends the game.

copy()[source]

Return a copy of this environment at the same state.

Return type:

JerichoEnv

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: bool

Determines if the game is still running.

Return type:

bool