powered by
Flip a coin
play_coin_flip( n = NULL, animate = rlang::is_interactive(), header = rlang::is_interactive() )
A character vector of "heads" or "tails" results.
"heads"
"tails"
How many coins to flip. Defaults to NULL, which interactively asks how many to flip.
NULL
If TRUE, play an animation before revealing the result. Defaults to TRUE if the session is interactive and FALSE otherwise.
TRUE
FALSE
If TRUE, prints a header for the game. Defaults to TRUE if the session is interactive and FALSE otherwise.
play_coin_flip(1) if (rlang::is_interactive()) play_coin_flip()
Run the code above in your browser using DataLab