This vignette shows how to play bootwar using a deck built with an anonymous function rather than the standard 52 card deck.
Use the deck_of_cards parameter of shuffle_deck() to define a custom deck of cards.
seed <- 123
set.seed(seed)
# Shuffle the deck
adeck <- mmcards::shuffle_deck(
deck_of_cards = function(x) {as.integer(stats::runif(52, 1, 208))},
seed = seed
)
head(adeck)
#> card value
#> 7 7 30
#> 27 27 99
#> 32 32 123
#> 38 38 147
#> 25 25 95
#> 34 34 136
The rest of the workflow follows the same structure as the README.
gres <- analyze_game(plyr_vv = rres$plyr_vv, comp_vv = rres$comp_vv,
mode = "pt", nboot = 1000, seed = 150, conf.level = 0.05)
# Display game results
gres$winner
#> [1] "Computer Wins"
gres$bootstrap_results$effect.size
#> [1] -12.2
gres$bootstrap_results$ci.effect.size
#> 47.5% 52.5%
#> -2.4 0.6
gres$bootstrap_results$p.value
#> [1] 0.685