yahtzR: yahtzR

Description Usage Arguments Details Examples

View source: R/yahtzR.R

Description

Play variations of the well-known dice rolling game in an R session.

Usage

1
2
yahtzR(variation = "yahtzee", rolls_per_turn = 3, work.mode = FALSE,
  graphical = TRUE)

Arguments

variation

Character value. Name of game variation and ruleset to apply. Valid options are:

  • "yahtzee" - Official Yahtzee game with "Forced Joker" rules. Wikipedia

  • "yatzy" - The public domain variation of the game. Wikipedia

  • "forced_yatzy" - Regular Yatzy, but you have to fill the card from top to bottom (see previous wiki).

  • "maxi_yatzy" - Version of Yatzy with 6 dice, and some extra game rules. Wikipedia

  • "mitzy" - a simplified, 4 dice game with rules similar to Yatzy.

rolls_per_turn

Integer value. The number of dice rolls allowed per turn. Usually (and by default) 3, but can be changed to any other value to create your own bespoke game variation.

work.mode

Logical. If TRUE, then display the game in a manner which looks a bit more like you're actually working!

N.B. I accept no responsibility if your boss still notices!

graphical

Logical, TRUE by default. If set, and ggplot2 is installed, the game also plots your scorecard as a ggplot. Will vary the outputs, both to entertain you, and to make it look like you're developing some interesting charts (useful in work mode?).

Details

Yatzy (and variants) are a classic dice rolling game and, heck, why not play then in an R console instead of doing some important machine learning or whatever.

Work mode prints minimal help messages and prompting, but accepts exactly the same inputs as regular mode. It assumes that you have already played in regular (verbose) mode and therefore understand what inputs are available at the various prompts.

Type "help" or "?" at any prompt for more information.

Examples

1
2
3
4
  yahtzR(work.mode=T)

  #This is just a silly idea :)
  yahtzR(variation="yatzy", rolls_per_turn = 10)

JerBoon/yahtzR documentation built on Oct. 30, 2019, 7:39 p.m.