add_snakesandladders: Applies snake and ladder transitions to the board.

Description Usage Arguments Value Examples

Description

add_snakesandladders() applies the start and end points of all of the snakes and ladders on the board. The input is stored in a two column matrix, which can be assigned manually or through the function snakes_and_ladders_sim. This function changes the numbers on the board to match where each snake or ladders ends. For example, if a snake leads from square 55 to square 32, then the number 55 in the board vector is replaced by 32.

Usage

1
add_snakesandladders(snakematrix, board)

Arguments

snakematrix

A two column matrix listing the starting points of snakes/ladders in the left column and the endpoints in the right

board

A vector of all numbers from 1 to the length of the board. Index represents board position, value represents what square you end up on in that position

Value

A new board vector with values replaced corresponding to the locations of snakes and ladders

Examples

1
add_snakesandladders(snakematrix = default_ladders_and_snakes, board = default_input_board)

iawindham/snakesandladders documentation built on May 20, 2019, 2:08 p.m.