#' Test if a betting round has ended.
#'
#' @param bets A vector representing each player's total contribution
#' to the pot.
#' @param skip A logical vector representing which players have folded.
#' @param counter The total number of actions that have been made
#' in the betting round so far.
#'
#' @return
#' @export
#'
#' @examples
end_criteria <- function(bets,skip,counter){
#First check to see everyone has folded except one.
n <- length(skip)
if(sum(skip) == n-1){
return(TRUE)
} else if(
equal(bets[!skip]) && (counter >= sum(!skip))
){
return(TRUE)
} else return(FALSE)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.