#' Display a Poker HUD
#'
#' @param players A list containing objects of the S4 class `player`.
#' @param turn The index of the player who is due to act.
#' @param pot The current size of the pot.
#' @param bets A vector representing the total contribution of each player to the pot.
#'
#' @export
#'
display <- function(players,turn,pot,bets){
n <- length(players)
names(bets) <- paste("Player",1:n)
cat(sep="\n",
paste("PLAYER",turn,"TO ACT"),
paste("Pot:",pot),
paste("Chips:",players[[turn]]@chips)
)
cat("Hand: ")
cat(names(players[[turn]]@hand),sep=", ")
cat("\n")
cat("Community: ")
cat(names(players[[turn]]@community),sep=", ")
cat("\n")
print(bets)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.