generate_world {karel} | R Documentation |
Create Karel's world
Description
This function takes a "world" (i.e. a list with data about its size, walls, beepers and Karel's position and direction), plots it and prepares everything so that Karel can start performing actions in it. It must be run always before Karel starts working on her goals, especially if we have made a mistake, we must start all over again by first running this function.
Usage
generate_world(world)
Arguments
world |
Character vector of length 1 with the name of one of the provided worlds in the package or a list provided by the user with all the components that a world needs (see more below in details). |
Details
After running generate_mundo()
, we can run Karel's actions and finally
visualize it all with the function run_actions()
.
Argument world
can be create by the user. In this case, it
must be a list with the following components:
-
nx
: TODO -
ny
: -
hor_walls
: -
ver_walls
: -
karel_x
: -
karel_y
: -
karel_dir
: -
beepers_x
: -
beepers_y
: -
beepers_n
: -
beepers_bag
:
Value
Plots the initial state of Karel's world and prepares everything to start recording her actions.
See Also
Examples
generate_world("mundo001")