Description Usage Arguments Details Value Warning Author(s) Examples
View source: R/AverageMovesToWin.R
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.
1 | AverageMovesToWin(number.of.players = 2, number.of.trials = 1000)
|
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. |
Function uses a simple for loop to run many trials of the SnakesAndLaddersGame, counts the number of moves and outputs an average.
average.number.of.moves |
A numeric value which represents the average number of moves to win |
I have not put a limit on the amount of time that this function will run. This is to allow millions of trials.
Hector Haffenden haffendenh@cardiff.ac.uk
1 2 3 | AverageMovesToWin(1)
AverageMovesToWin(100)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.