Blackjack

Blackjack is a language to specify randomizers, first proposed by Lardarse and expanded to cover history-style randomizers by Tepples. The name is derived from the similarity of the original proposal to the way cards are shuffled in the card game Blackjack. It is intended to be useful both for human beings to read and for computers to parse. Tepples expects to add a Blackjack interpreter as a randomizer option in future versions of Lockjaw for PC.

Syntax

 * Choose a piece at random from the comma-separated list and deal it. Duplicates are permitted, making the duplicated pieces more likely. Equivalent to,  , or.
 * Choose a piece at random from the comma-separated list and deal it. Duplicates are permitted, making the duplicated pieces more likely. Equivalent to,  , or.


 * Make a bag of list and deal them all in random sequence, then reshuffle. Equivalent to.
 * Make a bag of list and deal them all in random sequence, then reshuffle. Equivalent to.


 * Make a bag of list and deal the first number in random sequence, then reshuffle.
 * Make a bag of list and deal the first number in random sequence, then reshuffle.


 * Starting with the first piece of list, deal each piece in turn. When the end of the list is reached, start again from the beginning. Equivalent to
 * Starting with the first piece of list, deal each piece in turn. When the end of the list is reached, start again from the beginning. Equivalent to


 * Keep a list called history of the last len pieces dealt. (Repeated pieces in list are separate pieces for purpose of the history.) Choose a piece at random from list which is not in history and deal it. Then put the piece in history and remove the oldest piece from history.
 * Keep a list called history of the last len pieces dealt. (Repeated pieces in list are separate pieces for purpose of the history.) Choose a piece at random from list which is not in history and deal it. Then put the piece in history and remove the oldest piece from history.


 * Keep a list called history of the last len pieces dealt. (Repeated pieces in list are separate pieces for purpose of the history.) Up to number times, choose a piece at random from list, and if it is not in history, deal it. Otherwise, deal the last piece chosen. Then put the piece in history and remove the oldest piece from history.
 * Keep a list called history of the last len pieces dealt. (Repeated pieces in list are separate pieces for purpose of the history.) Up to number times, choose a piece at random from list, and if it is not in history, deal it. Otherwise, deal the last piece chosen. Then put the piece in history and remove the oldest piece from history.


 * Follow spec, except choose the first piece from list.
 * Follow spec, except choose the first piece from list.

Examples

 * Random Generator


 * 14-piece bag


 * 14-piece bag, dealt halfway


 * Memoryless


 * Memoryless including small pieces


 * Memoryless more difficult (10% I)


 * SZSZ


 * Move to Back


 * SZSZ alternating


 * TGM1 randomizer


 * TGM2/3 randomizer


 * Lardarse's more difficult

Reference implementation
As of December 2006, Tepples is coding a reference implementation of Blackjack in the C language.


 * 1) Randomizer engine: done
 * 2) Spec parser
 * 3) Integration with Lockjaw