Learn R Programming

SnakesAndLaddersAnalysis (version 2.1.0)

PlotMyGame: Plots the game of Snakes and Ladders

Description

This function plots the result from the SnakesAndLaddersGame Function.

Usage

PlotMyGame(output.from.SnakesAndLaddersGame.function, legend = TRUE)

Arguments

output.from.SnakesAndLaddersGame.function

The output from the SnakesAndLaddersGame function.

legend

Takes value TRUE or FALSE, if TRUE, displays the legend for the plot.

Value

A plot

Plots the players position on each roll.

Details

Function that takes output from the SnakesAndLaddersGame function and plots it with an appropriate legend and nice colours to represent each players game. Only accepts number of players between 1 and 7.

Examples

Run this code
# NOT RUN {
PlotMyGame(SnakesAndLaddersGame(1))

PlotMyGame(SnakesAndLaddersGame(3))

PlotMyGame(SnakesAndLaddersGame(7))

# }

Run the code above in your browser using DataLab