#' Deal the flop cards to all the players
#'
#' @param n The number of players to deal to.
#' @param ncard The number of cards to deal to each player.
#' @param players A list of elements from the S4 class "player"
#' @param deck The deck from which the cards are to be dealt from.
#'
#' @return A list containing the players, as well as a last element
#' containing the deck.
#' @export
#' @examples
deal_to_players <- function(n,ncards,players,deck){
cards <- new_cards(ncards,deck)
deck <- cards[[ncards+1]]
cards <- cards[-(ncards+1)]
for (i in 1:n){
for(j in 1:ncards){
players[[i]]@community <- c(players[[i]]@community,cards[j])
}
}
return(c(players,deck))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.