CONSTANT: perm7 { { 0 1 2 3 4 } { 0 1 2 3 5 } { 0 1 2 3 6 } { 0 1 2 4 5 } { 0 1 2 4 6 } { 0 1 2 5 6 } { 0 1 3 4 5 } { 0 1 3 4 6 } { 0 1 3 5 6 } { 0 1 4 5 6 } { 0 2 3 4 5 } { 0 2 3 4 6 } { 0 2 3 5 6 } { 0 2 4 5 6 } { 0 3 4 5 6 } { 1 2 3 4 5 } { 1 2 3 4 6 } { 1 2 3 5 6 } { 1 2 4 5 6 } { 1 3 4 5 6 } { 2 3 4 5 6 } } :: make-subhand ( i hand -- seq ) [ 5 [ i perm7 nth nth hand nth , ] each ] { } make ; :: (eval-7hand) ( i hand best -- best ) i hand make-subhand hand-value dup best < [ drop best ] unless i 20 < [ [ i 1 + hand ] dip (eval-7hand) ] when ; :: eval-7hand ( seq -- ckf ) 0 seq 9999 (eval-7hand) seq swap hand boa ; ! example "As Kd Jc Kh 2d 2d Kh" 7cards eval-7hand >value => "Full House"