Handbook
Glossary
value>rank ( value -- rank )
Vocabulary
poker
.
private
Inputs
value
an
object
Outputs
rank
an
object
Definition
USING:
combinators
kernel
math
;
IN:
poker.private
:
value>rank
( value -- rank )
{
{
[
dup
6185
>
]
[
drop
HIGH_CARD
]
}
{
[
dup
3325
>
]
[
drop
ONE_PAIR
]
}
{
[
dup
2467
>
]
[
drop
TWO_PAIR
]
}
{
[
dup
1609
>
]
[
drop
THREE_OF_A_KIND
]
}
{
[
dup
1599
>
]
[
drop
STRAIGHT
]
}
{
[
dup
322
>
]
[
drop
FLUSH
]
}
{
[
dup
166
>
]
[
drop
FULL_HOUSE
]
}
{
[
dup
10
>
]
[
drop
FOUR_OF_A_KIND
]
}
[
drop
STRAIGHT_FLUSH
]
}
cond
;