Generate array which shows moves that Karel can and can't make
Código:R/set_up.R
generate_open_moves.Rd
This function creates open_moves
, a nx x ny x 4 array of TRUE/FALSE
values indicating if Karel can move to each direction from a given position.
For example, if Karel is in the bottom left corner, which is cell [1, 1], it
can't go south or left, so we have both open_moves[1, 1, 3] and open_moves[1,
1, 4] set to FALSE. Depending on the existing walls it could move south or
north, so open_moves[1, 1, 1] and open_moves[1, 1, 2] could be TRUE or FALSE.
Argumentos
- nx,
ny size of the world
- hor_walls,
ver_walls dataset of horizontal and vertical walls as described in the details for the function
.generate_world
.