#' Remove a list of specified cards from another list of specified cards.
#'
#' @param cards A list of objects from the S4 class 'card'.
#' @param remove A list of objects from the S4 class 'card' which will be
#' removed from the list.
#'
#' @return A list of objects from the S4 class 'card'.
#' @export
#'
#' @examples
remove_cards <- function(cards,remove){
to_remove <- c()
for (i in 1:length(remove)){
for (j in 1:length(cards)){
if(
(remove[[i]]@suit == cards[[j]]@suit) && (remove[[i]]@value == cards[[j]]@value)
) to_remove <- c(to_remove,j)
}
}
cards<- cards[-to_remove]
return(cards)
}
set.seed(1234)
cards <- new_cards(5,new_deck())[-6]
cards[[4]]@value <- 7
cards <- remove_cards(cards,exists_n_kind(cards,3)$cards)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.