Blackjack: Difference between revisions

From TetrisWiki
Jump to navigation Jump to search
*>Tepples
(clarify Lardarse's contribution)
No edit summary
 
(13 intermediate revisions by 5 users not shown)
Line 1: Line 1:
'''Blackjack''' is a language to specify [[Glossary#R|randomizers]], first proposed by TC forum members [[user:Lardarse|Lardarse]] and expanded to cover [[TGM randomizer|history-style randomizers]] by [[user:Tepples|Tepples]].
'''Blackjack''' is a language to specify [[Glossary#R|randomizers]], first proposed by [[user:Lardarse|Lardarse]] and expanded to cover [[TGM randomizer|history-style randomizers]] by [[user:Tepples|Tepples]].
The name is derived from the similarity of the  
The name is derived from the similarity of the original proposal to [http://en.wikipedia.org/wiki/Blackjack#Card_counting 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.
It is intended to be useful both for human beings to read and for computers to parse.
Tepples expects to replace the randomizer in future versions of [[Lockjaw]] with a Blackjack interpreter.
Tepples expects to add a Blackjack interpreter as a randomizer option in future versions of [[Lockjaw]] for PC.


== Syntax ==
== Syntax ==
;<code>''list''</code>
;<code>''list''</code>
:Choose a piece at random from the comma-separated ''list'' and deal it. Duplicates are permitted, making the duplicated pieces more likely. Equivalent to <code>1 bag of ''list''</code>.
:Choose a piece at random from the comma-separated ''list'' and deal it. Duplicates are permitted, making the duplicated pieces more likely. Equivalent to <code>1 bag of ''list''</code>, <code>''list'' with 0 history</code>, or <code>''list'' with ''len'' history 1 rolls</code>.
;<code>bag of ''list''</code>
;<code>bag of ''list''</code>
:Make a bag of ''list'' and deal them all in random sequence, then reshuffle. Equivalent to <code>''len(list)'' bag of ''list''</code>.
:Make a bag of ''list'' and deal them all in random sequence, then reshuffle. Equivalent to <code>''len(list)'' bag of ''list''</code>.
;<code>''number'' bag of ''list''</code>
;<code>''number'' bag of ''list''</code>
:Make a bag of ''list'' and deal the first ''number'' in random sequence, then reshuffle. The similarity of this method to [http://en.wikipedia.org/wiki/Blackjack#Card_counting the randomizer in the card game Blackjack] is the origin of the name of the language.
:Make a bag of ''list'' and deal the first ''number'' in random sequence, then reshuffle.
;<code>sequence of ''list''</code>
: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 <code>''list'' with ''len(list)-1'' history</code>
;<code>''list'' with ''len'' history</code>
;<code>''list'' with ''len'' history</code>
: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''.
Line 19: Line 21:


== Examples ==
== Examples ==
;[[Random Generator]]
;7-piece bag ([[Random Generator]])
:<code>bag of I,J,L,O,S,T,Z</code>
:<code>bag of I,J,L,O,S,T,Z</code>
;14-piece bag
;14-piece bag
Line 25: Line 27:
;14-piece bag, dealt halfway
;14-piece bag, dealt halfway
:<code>7 bag of I,I,J,J,L,L,O,O,S,S,T,T,Z,Z</code>
:<code>7 bag of I,I,J,J,L,L,O,O,S,S,T,T,Z,Z</code>
;Memoryless
;[http://en.wikipedia.org/wiki/Memorylessness Memoryless], uniform
:<code>I,J,L,O,S,T,Z</code>
:<code>I,J,L,O,S,T,Z</code>
;Memoryless including small [[piece]]s
;Memoryless, uniform including small [[piece]]s
:<code>I,J,L,O,S,T,Z,I2,I3,L3</code>
:<code>I,J,L,O,S,T,Z,I2,I3,L3</code>
;Memoryless more difficult (10% I)
;Memoryless, more difficult (10% I)
:<code>I,I,J,J,J,L,L,L,O,O,O,S,S,S,T,T,T,Z,Z,Z</code>
:<code>I,I,J,J,J,L,L,L,O,O,O,S,S,S,T,T,T,Z,Z,Z</code>
;SZSZ
;SZSZ
Line 37: Line 39:
;SZSZ alternating
;SZSZ alternating
:<code>S,Z with 1 history</code>  
:<code>S,Z with 1 history</code>  
;[[TGM randomizer|TGM1 randomizer]]
;[[TGM randomizer|TGM1 randomizer]] (Incomplete, as this notation lacks a definition of the initial state of the history)
:<code>I,J,L,O,S,T,Z with 4 history 4 rolls first I,J,L,T</code>
:<code>I,J,L,O,S,T,Z with 4 history 4 rolls first I,J,L,T</code>
;[[TGM randomizer|TGM2/3 randomizer]]
;[[TGM randomizer|TGM2/3 randomizer]] (Incomplete, as this notation lacks a definition of the initial state of the history)
:<code>I,J,L,O,S,T,Z with 4 history 6 rolls first I,J,L,T</code>
:<code>I,J,L,O,S,T,Z with 4 history 6 rolls first I,J,L,T</code>
;Lardarse's more difficult
;Lardarse's more difficult
:<code>5 bag of I,T,J,J,L,L,O,O,S,S,S,Z,Z,Z</code>
:<code>5 bag of I,T,J,J,L,L,O,O,S,S,S,Z,Z,Z</code>
;Euchre
:<code>20 bag of S9,S10,SJ,SQ,SK,SA,H9,H10,HJ,HQ,HK,HA,D9,D10,DJ,DQ,DK,DA,C9,C10,CJ,CQ,CK,CA</code>
== Reference implementation ==
{{outdated}}
As of December 2006, Tepples is coding a reference implementation of Blackjack in the C language.
#Randomizer engine: '''done'''
#Spec parser
#Integration with Lockjaw
[[Category:Randomizers]]

Latest revision as of 01:49, 4 September 2019

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

list
Choose a piece at random from the comma-separated list and deal it. Duplicates are permitted, making the duplicated pieces more likely. Equivalent to 1 bag of list, list with 0 history, or list with len history 1 rolls.
bag of list
Make a bag of list and deal them all in random sequence, then reshuffle. Equivalent to len(list) bag of list.
number bag of list
Make a bag of list and deal the first number in random sequence, then reshuffle.
sequence of list
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 list with len(list)-1 history
list with len 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.
list with len history number rolls
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.
spec first list
Follow spec, except choose the first piece from list.

Examples

7-piece bag (Random Generator)
bag of I,J,L,O,S,T,Z
14-piece bag
bag of I,I,J,J,L,L,O,O,S,S,T,T,Z,Z
14-piece bag, dealt halfway
7 bag of I,I,J,J,L,L,O,O,S,S,T,T,Z,Z
Memoryless, uniform
I,J,L,O,S,T,Z
Memoryless, uniform including small pieces
I,J,L,O,S,T,Z,I2,I3,L3
Memoryless, more difficult (10% I)
I,I,J,J,J,L,L,L,O,O,O,S,S,S,T,T,T,Z,Z,Z
SZSZ
S,Z
Move to Back
I,J,L,O,S,T,Z with 4 history
SZSZ alternating
S,Z with 1 history
TGM1 randomizer (Incomplete, as this notation lacks a definition of the initial state of the history)
I,J,L,O,S,T,Z with 4 history 4 rolls first I,J,L,T
TGM2/3 randomizer (Incomplete, as this notation lacks a definition of the initial state of the history)
I,J,L,O,S,T,Z with 4 history 6 rolls first I,J,L,T
Lardarse's more difficult
5 bag of I,T,J,J,L,L,O,O,S,S,S,Z,Z,Z
Euchre
20 bag of S9,S10,SJ,SQ,SK,SA,H9,H10,HJ,HQ,HK,HA,D9,D10,DJ,DQ,DK,DA,C9,C10,CJ,CQ,CK,CA

Reference implementation

Outdated content
This page is outdated, but if it were updated, it might still be useful. Please help by correcting, augmenting and revising the text into an up-to-date form.

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