Skip to content

Instantly share code, notes, and snippets.

@denis
Created April 23, 2010 12:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save denis/376479 to your computer and use it in GitHub Desktop.
Save denis/376479 to your computer and use it in GitHub Desktop.
/*
random
AcKd
AK
AKs
AKo
TT+
77-KK
QQ,AQs,77,44-22,KK+
AJs-A9s
K9o+
*/
@start = range;
range = randomCards | hands;
hands = hand commaHand*;
hand = twoCards | twoRanks | twoRanksSuited | twoRanksUnsuited | openRange | closedRange;
randomCards = 'random';
twoCards = card card;
twoRanks = rank rank;
twoRanksSuited = twoRanks suited;
twoRanksUnsuited = twoRanks unsuited;
suited = 's';
unsuited = 'o';
openRange = twoRanks plus;
closedRange = twoRanks minus twoRanks;
plus = '+';
minis = '-';
commaHand = comma hand;
card = rank suit;
rank = ace | king | queen | jack | ten | nine | eight | seven | six | five | four | three | two;
ace = 'A';
king = 'K';
queen = 'Q';
jack = 'J';
ten = 'T';
nine = '9';
eight = '8';
seven = '7';
six = '6';
five = '5';
four = '4';
three = '3';
two = '2';
suit = hearts | diamonds | clubs | spades;
hearts = 'h';
diamonds = 'd';
clubs = 'c';
spades = 's';
comma = ',';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment