Description Usage Arguments Value Examples
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.
1 | add_snakesandladders(snakematrix, board)
|
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 |
A new board vector with values replaced corresponding to the locations of snakes and ladders
1 | add_snakesandladders(snakematrix = default_ladders_and_snakes, board = default_input_board)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.