Skip to content

Commit

Permalink
RELEASE 1.3.0 - Game now has "Maxi Yatzy" game option (with 6 dice to…
Browse files Browse the repository at this point in the history
… roll)
  • Loading branch information
JerBoon committed Sep 20, 2019
1 parent f9a2c69 commit 27e4f47
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 3 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: yahtzR
Type: Package
Title: Play variations of the well-known dice rolling game in an R session
Version: 1.2.1
Version: 1.3.0
Author: Jer Boon
Maintainer: Jer Boon <[email protected]>
Description:
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,16 @@
# yahtzR 1.3.0

Added "maxi_yatzy" game option - the game with 6 dice, and the ability to store
and use unused dice rolls later on..

# yahtzR 1.2.0

Behind the scenes, much of the gamme variation related code is now implemented
with S3 methods.

Added game variations for Yatzy and a 4 dice variation of said.

"Long straight" nor relabled as "Large straight".
"Long straight" now relabled as "Large straight".

Change to the argument calls for the yahtzR() function. Introduces a slight backward
incompatibility to previous releases. Apologies to my zero users...
Expand Down
2 changes: 1 addition & 1 deletion R/calc_scores.maxi_yatzy.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ calc_scores.maxi_yatzy <- function(game) {

t[t$section == "1p","score.available"] <- {if (x[1] >= 2) (max(as.integer(names(x)[x >= 2]))*2) else 0}
t[t$section == "2p","score.available"] <- (x[1] >= 2)*(length(x) > 1 & x[2] >= 2)*
(sum(as.integer(names(x)[1:2]))*2)
(sum(as.integer(sort(names(x)[x >= 2], decreasing=T)[1:2]))*2)
t[t$section == "3p","score.available"] <- (x[1] == 2)*(length(x) > 1 & x[2] == 2)*(length(x) > 2 & x[3] == 2)*
sum(game$dice)

Expand Down

0 comments on commit 27e4f47

Please sign in to comment.