Description Usage Arguments Details Value Examples
The play_game()wraps up all the previously stated game steps into one function and returns the data frame that contains the results from one game.
1 |
The |
stay argument is a logical vector, as it includes values of either "True" or "False" |
The play_game() includes all the codes used in the previous 5 steps with the aim of returning the data frame that includes all the results related to one game, which means means no repetition. Therefore, we need to use the loop() to check which is the more dominant strategy, the stay or the switch strategy.The returned result after running the function is a length of one character vector indicating whether the contestant has won or not
The returned result from the function is a length of one character vector indicating whether the contestant has won or not
1 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.