AJAX Farkle

 

What does the design of a Farkle game look like? At it’s core, Farkle is a very simple dice game. There are six dice, and players take turns rolling the dice and keeping track of the score as indicated by the rolls:


A single die which turns up 1 is worth 100 points.

A single die which turns up 5 is worth 50 points.

Three of a kind (on a single roll) is worth 100 * the value, or 1,000 if the dice are 1s.

Four of a kind (on a single roll) is worth 2 * three of a kind.

Five of a kind (on a single roll) is worth 4 * three of a kind.

Six of a kind (on a single roll) is worth 8 * three of a kind.

A straight (1,2,3,4,5,6) on a singl roll is worth 1,500 points.

Three pairs (on a single roll) is worth 1,000 points.

Two triples (on a single roll) is worth 2,000 points.


A score of at least 500 points is required to enter the game.


Upon each throw, the player selects scorable dice. If there are no scorable dice, the player has “farkled,” and is out. The player may elect to roll the non-scorable dice again, in an effort to earn more points. (However, note that the above chart does indicate that combinations must be earned on a single roll.)


If all six dice are scorable, the player can elect to note down his score and throw all six dice again, combining the results. Just as any other roll, if no dice come up scorable, the player has farkled and earns no points.


In standard Farkle, farkling three times in a row typically incurs a -1,000 point bonus. If I were to do a web version, I would like not enforce that rule.


While the AJAX piece and the core logic to drive the dice and scoring a relatively easy, two extremely hard pieces appear to come into play: 1) state maintenance and 2) opponent AI.