AverageMovesToWin: The Average Moves to Win in a Game of Snakes and Ladders

Description Usage Arguments Details Value Warning Author(s) Examples

View source: R/AverageMovesToWin.R

Description

This function uses the function SnakesAndLaddersGame to estimate the average number of moves to win given any amount of players and allows you to change the number of trials used.

Usage

1
AverageMovesToWin(number.of.players = 2, number.of.trials = 1000)

Arguments

number.of.players

A single numeric value that represents the number of players you wish to run the trial with

number.of.trials

A single numeric value that represents the number of trials you wish to run. The more trials the more accurate the estimation.

Details

Function uses a simple for loop to run many trials of the SnakesAndLaddersGame, counts the number of moves and outputs an average.

Value

average.number.of.moves

A numeric value which represents the average number of moves to win

Warning

I have not put a limit on the amount of time that this function will run. This is to allow millions of trials.

Author(s)

Hector Haffenden haffendenh@cardiff.ac.uk

Examples

1
2
3

hectorhaffenden/SnakesAndLaddersAnalysis documentation built on April 16, 2020, 7:24 a.m.