View source: R/english_wrappers.R
generate_world | R Documentation |
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.
generate_world(world)
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). |
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
:
Plots the initial state of Karel's world and prepares everything to start recording her actions.
actions
run_actions
generate_world("mundo001")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.