Description Usage Arguments Details Value Examples
View source: R/Monty Hall Script.R
This function returns whether or not the player's final door choice contains the car or a goat. If the door was concealing the car, the player wins. If the door was concealing a goat, the player loses.
1 | determine_winner(final.pick, this.game)
|
final.pick |
A numeric vector of length one. |
this.game |
A character vector of length three. |
This function checks whether final door number is equal to the position of the car in the game. If yes, then "WIN" is returned. If no, then "LOSE" is returned.
This function returns whether or not the player won or lost.
1 2 3 | determine_winner(final.pick = 1, this.game = c("car", "goat", "goat"))
determine_winner(final.pick = 2, this.game = c("goat", "car", "goat"))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.