#' black jack (simpel)
#'
#' playing black jack (simple) with just 2 cards for each dealer and player
#'
#'
#' @return if u have won or lost vs the bank
#' @export bjs
#'
bjs <- function(){
cards <- c(seq(1:10),10,10,10,11)
play <- sum(sample(cards,2))
deal <- sum(sample(cards,2))
print(paste0("dealer has ",deal))
print(paste0("you have ",play))
if (deal==play){
print("tie")
} else if (deal<play){
print("you win")
} else {print("you lose")}
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.