Notes:
= Poker hand evaluator for Ruby
== Author
Robert Olson (rko618 [at] gmail [dot] com)
== License
This is free software; you can redistribute it and/or modify it under the
terms of the BSD license. See LICENSE for more details.
== Download
The latest version of <b>ruby poker</b> can be found at
* http://rubyforge.org/frs/?group_id=5257
The homepage of this project is located at
* http://rubyforge.org/projects/rubypoker
== Description
Ruby-Poker handles the logic for getting the rank of a poker hand. It can also be used
to compare two or more hands to determine which hand has the highest poker value.
Card representations can be passed to the PokerHand constructor as a string or an array.
Face cards (cards ten, jack, queen, king, and ace) are created using their
letter representation (T, J, Q, K, A).
== Examples
In this section some examples show what can be done with this class.
hand1 = PokerHand.new("8H 9C TC JD QH")
hand2 = PokerHand.new(["3D", "3C", "3S", "KD", "AH"])
puts hand1 => 8h 9c Tc Jd Qh (Straight)
puts hand1.just_cards => 8h 9c Tc Jd Qh
puts hand1.rank => Straight
puts hand2 => 3d 3c 3s Kd Ah (Three of a kind)
puts hand2.rank => Three of a kind
puts hand1 > hand2 => true
== Background
I (Robert Olson) wrote all of the code in the original version of ruby-poker which limited
hands to only 5 cards. As of the 0.2.0 release ruby-poker is based on Patrick Hurley's
Texas Holdem code from http://rubyquiz.com/quiz24.html which I merged into ruby-poker.
Changes:
2008-02-08 (0.2.1)
* Cards can be added to a hand after it is created by using (<<) on a PokerHand
* Cards can be deleted from a hand with PokerHand.delete()
|