A friendly R package for simulating rock-paper-scissors-lizard-spock games!
# To Install
devtools::install_github("ctesta01/RPSLS")
The app is live on https://ctesta.shinyapps.io/RPSLS/ π±ππ
The Rock, Paper, Scissors, Lizard, Spock game is a variant of Rock,
Paper, Scissors game invented by Sam Kass and Karen Bryla with Spock
signified using the Star Trek Vulcan salute, and lizard sometimes shown
in diagrams by forming the hand into a sock-puppet-like mouth 1. The
following diagram from Wikimedia2 explains how each game is resolved.
See the output of explain_the_game()
below for the logic behind the
diagram.
library(RPSLS)
explain_the_game()
## Scissors βοΈοΈ cuts Paper π
## Paper π covers Rock πͺ¨
## Rock πͺ¨ crushes Lizard π¦
## Lizard π¦ poisons Spock π
## Spock π smashes Scissors βοΈοΈ
## Scissors βοΈ decapitates Lizard π¦
## Lizard π¦ eats Paper π
## Paper π disproves Spock π
## Spock π vaporizes Rock πͺ¨
## (and as it always has) Rock πͺ¨ crushes Scissors βοΈ
sample_rpsls()
## You got Paper π
sample_rpsls(2)
## Your samples:
## Sample 1: Scissors βοΈ
## Sample 2: Lizard π¦
Two players can use the sample_rpsls_pair
function to simulate a
single-game between two people. The result can be that player 1 wins,
player 2 wins, or they tie.
sample_rpsls_pair()
## Player 1 chooses: Paper π
## Player 2 chooses: Rock πͺ¨
## Player 1 wins!
The app can be run after installing the package, loading it, and calling
RPSLS::app()
.
Watch the explanation video on YouTube:
Footnotes
-
Rock, Paper Scissors. https://en.wikipedia.org/wiki/Rock_paper_scissors β©
-
A resolution diagram of the game Rock, Paper, Scissors, Lizard, Spock. https://en.wikipedia.org/wiki/File:Pierre_ciseaux_feuille_l%C3%A9zard_spock_aligned.svg β©