R/calc_scores.forced_yatzy.R

Defines functions calc_scores.forced_yatzy apply_bonuses.forced_yatzy

# Forced Yatzy has all the same rules as Yatzy, *except* that the scoring options
# must be selected in the order they appear on the card
# Therefore all we need to do is re-use all the same methods as regular Yatzy, but to
# amend the list of available options before passing in back to the user
# selection engine..


calc_scores.forced_yatzy <- function(game) {

  t <- calc_scores.yatzy(game)

  first <- min(which(!is.na(t$score.available)))
  t[-first,"score.available"] <- NA

  return(t)
}

## ---------------------------------------------------------------

apply_bonuses.forced_yatzy <- function(game) {

  return(apply_bonuses.yatzy(game))

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