Forum: Ruby 5 Card Hand Evaluator

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
F62d0be4e8209c45a02d4f595014845a?d=identicon&s=25 Peter Marsh (killswitch)
on 2007-05-17 01:32
I've just finised writing a 5 card hand evaluator (I'm avoding the 'pkr'
word since the spam filter won't let me post when I use that word),
using the algorithm found:*/evaluator.html (<<
replace * with the 'pkr' word, same in the next link >>).

You can download it from here:*.zip

Use the 'eval' method. For the purposes of this code a card is defined
as an array where element [0] is a number 0..12 (0 = two, 1 = three ...
11 = king, 12 = ace) and element [1] is a number 0..2 (0 = clubs, 1 =
diamonds, 2 = hearts, 3 = spades).

The lower the value returned, the higher-ranking the hand. Enjoy.
This topic is locked and can not be replied to.