#' Simulate a game of Monopoly
#'
#' Simulate a game of Monopoly, iteratively running take_turn()
#' @param players number of players, an integer, defaults to 4
#' @param turn_limit maxiumum number of simulated turns, an integer, defaults to 1,000
#' @examples
#' \dontrun{
#' simulate_game(5, 100)
#' }
#' @export
#' simulate_game
simulate_game <- function(players = 4, turn_limit = 1000){
pb <- progress::progress_bar$new(total = turn_limit)
current <- set_up_game(players = players)
repeat{
current <- dplyr::bind_rows(current, take_turn(current))
pb$tick()
if(max(current$turn_id) >= turn_limit){
break
}
}
current
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.