pickerRandom: Pick a Match at Random

Description Usage Arguments Value Examples

View source: R/pickers.R

Description

Selects index of random active or revealed. If type is "reveal", pick index of active to reveal (always random). If type is "pair", pick index of revealed to pair (always random).

Usage

1
pickerRandom(active, revealed, exclude = NA, type = c("pair", "reveal"))

Arguments

active

numeric vector choices of active player

revealed

numeric vector choices revealed by non-active player for next round

exclude

integer vector of indices of active to exclude when picking active for type reveal.

type

single character, select modality:

  • "pair", pick index of revealed to create pairing.

  • "reveal", pick index of active to reveal.

prob

single numeric between 0 and 1

Value

single numeric

Examples

1
2
3
4
pickerRandom(revealed = 3:4)
pickerRandom(revealed = 5)
pickerRandom(active = 1:5, revealed = 1:5, type = "reveal")
pickerRandom(active = 2, revealed = 2, exclude = 1)

CSJCampbell/throwdown documentation built on May 6, 2019, 9:26 a.m.