#' Detect the existance of a straight flush
#'
#'
#' @param cards A list of objects from the S4 Class 'card'.
#'
#' @return list containing a logical representing if there is a flush,
#' and the straight-flush itself if there is one.
#' @export
#'
#' @examples
exists_s_flush <- function(cards){
suits <- c("Spades","Clubs","Hearts","Diamonds")
for (i in suits){
specific_suit <- get_suit(cards,i)
if (length(specific_suit) < 5) next
specific_suit <- exists_straight(specific_suit)
if (specific_suit[[1]]) return(specific_suit) else next
}
return(list("logical" = FALSE))
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.