Egison
1 program
Added 2026-02-05T21:04:17Z
Agent: claude-codeModel: opusWebSearch: enabled
Evidence
Report issue
View issues
Aliases: —
Provenance: commit 8b754f5b74 · authored 2026-02-05T22:05:04+01:00 · agent claude-code · model opus
Sources mentioning this language
3 sources · pl_id:
pl/egisonRelated languages
LLM-contributed programs
Poker Hand Classification
Provenance: commit 8b754f5b74 · authored 2026-02-05T22:05:04+01:00 · agent claude-code · model opus · WebSearch enabled
def suit := algebraicDataMatcher
| spade
| heart
| club
| diamond
def card := algebraicDataMatcher
| card suit (mod 13)
def poker cs :=
match cs as multiset card with
| [card $s $n, card #s #(n-1), card #s #(n-2), card #s #(n-3), card #s #(n-4)]
-> "Straight flush"
| [card _ $n, card _ #n, card _ #n, card _ #n, _]
-> "Four of a kind"
| [card _ $m, card _ #m, card _ #m, card _ $n, card _ #n]
-> "Full house"
| [card $s _, card #s _, card #s _, card #s _, card #s _]
-> "Flush"
| [card _ $n, card _ #(n-1), card _ #(n-2), card _ #(n-3), card _ #(n-4)]
-> "Straight"
| [card _ $n, card _ #n, card _ #n, _, _]
-> "Three of a kind"
| [card _ $m, card _ #m, card _ $n, card _ #n, _]
-> "Two pair"
| [card _ $n, card _ #n, _, _, _]
-> "One pair"
| [_, _, _, _, _] -> "Nothing"
assertEqual "poker hand 1"
(poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 8, Card Spade 9])
"Straight flush"
assertEqual "poker hand 2"
(poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 5])
"Four of a kind"
assertEqual "poker hand 3"
(poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 7])
"Full house"
assertEqual "poker hand 4"
(poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 13, Card Spade 9])
"Flush"
assertEqual "poker hand 5"
(poker [Card Spade 5, Card Club 6, Card Spade 7, Card Spade 8, Card Spade 9])
"Straight"
assertEqual "poker hand 6"
(poker [Card Spade 5, Card Diamond 5, Card Spade 7, Card Club 5, Card Heart 8])
"Three of a kind"
assertEqual "poker hand 7"
(poker [Card Spade 5, Card Diamond 10, Card Spade 7, Card Club 5, Card Heart 10])
"Two pair"
assertEqual "poker hand 8"
(poker [Card Spade 5, Card Diamond 10, Card Spade 7, Card Club 5, Card Heart 8])
"One pair"
assertEqual "poker hand 9"
(poker [Card Spade 5, Card Spade 6, Card Spade 7, Card Spade 8, Card Diamond 11])
"Nothing"
Real programs from Software Heritage
No SWH evidence indexed yet for this language. (Either the SWH mining hasn't reached this language's extensions, or no matching files exist in the archive.)