create_beepers: Create dataset about beepers

View source: R/set_up.R

create_beepersR Documentation

Create dataset about beepers

Description

Given the elements provided in the world, this function generates a dataset with info about the beepers present in the world. This function is called from generar_mundo().

Usage

create_beepers(nx = NULL, pos_x = NULL, pos_y = NULL, n = NULL, moment = 1)

Arguments

nx

horizontal size of the world

pos_x

pos_y vectors of coordinates of cells with non-zero amount of beepers

n

number of beepers in each cell indicated by coordinates in pos_x and pos_y

moment

time

Value

A tibble with as many rows as cells with beepers in the world and 5 columns: x and y for the coordinates of the cell, cell is the number of the cell counting as cell number 1 the cell in the bottom left corner and going upwards by row (meaning cell number 2 would be the cell in coordinates x=2 and y=1), n the number of beepers in this cell and moment the moment in which this state of the world corresponds to.


mpru/karel documentation built on May 12, 2024, 5:16 p.m.