Description Usage Arguments Value Examples
Play a game by providing a sequence of numbers (typically 5). The game is played in the following sequence:
player a reveals her first number
player b reveals his first two numbers
player a selects one of player b's revealed numbers to match with her revealed number
player a reveals her next two numbers
player b selects one of player a's revealed numbers to match with his revealed number
player b reveals his next two numbers
player a selects one of player b's revealed numbers to match with her revealed number
player a reveals her next two numbers
player b selects one of player a's revealed numbers to match with his revealed number
the remaining two numbers are matched.
For each match, the player with the higher number wins one point. The player with the most points wins the game. The picker functions must have arguments active, revealed, type and exclude. active and revealed must be numeric vectors. type must be a length 1 character vector with value "reveal" or "pair". If type is "reveal", the function must pick the index of active to reveal. If type is "pair", the function must pick index of revealed to pair. exclude must be NA, or a numeric vector, which is the index of revealed to ignore when type is "reveal".
1 | pairingGame(a, b, strata = pickerFirst, stratb = pickerFirst)
|
a |
numeric vector of player a pieces |
b |
numeric vector of player b pieces of length a |
strata |
picker function to select between two numbers for player a |
stratb |
picker function to select between two numbers for player b |
length 2 vector number of wins for player a and player b
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 | pairingGame(a = 1:5, b = 5:1)
pairingGame(a = 10:14, b = 10:14)
pairingGame(a = 1:5, b = c(5, 1:4))
pairingGame(a = rep(1, 5), b = rep(1, 5),
strata = pickerFirst, stratb = pickerFirst)
pairingGame(a = 1:5, b = 5:1, strata = pickerRandom)
pairingGame(a = 1:5, b = c(5, 1:4),
strata = pickerRandom, stratb = pickerRandom)
pairingGame(a = 1:5, b = c(5, 1:4),
strata = pickerRandom, stratb = pickerMax)
pairingGame(a = 1:5, b = c(5, 1:4),
strata = pickerRandom, stratb = pickerJustMax)
set.seed(22532)
pairingGame(a = sample(1:5, size = 5), b = sample(1:5, size = 5),
strata = pickerRandom, stratb = pickerRandom)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.