--------------000503060202040102080806 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This was a fun one :) I'm looking forward to seeing other solutions. Regs, Derek -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (MingW32) iD8DBQFCPX/KxPPkePIbSlwRAoexAKDgcRpsOdBoAujcknMiQWriyjKDWACg1vvn fvyLC2qKvFRFMSB5LE77dxc Kj -----END PGP SIGNATURE----- --------------000503060202040102080806 Content-Type: text/plain; name oldem.rb" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename oldem.rb" #!/usr/local/bin/ruby -w # Global mappings of cards to numbers $values "A" 1, "2" 2, "3" 3, "4" 4, "5" 5, "6" 6, "7" 7, "8" 8, "9" 9, "T" 10, "J" 11, "Q" 12, "K" 13, "X" 14 # this is an ace high, as opposed to ace low } # Just to make things pretty -- but Six plural i don't handle $strs "A" "Ace", "2" "Two", "3" "Three", "4" "Four", "5" "Five", "6" "Six", "7" "Seven", "8" "Eight", "9" "Nine", "T" "Ten", "J" "Jack", "Q" "Queen", "K" "King" } # This is the class that handles everything for us. Holds onto the hand # and classifies it class Classifier attr_reader :rank, :folded, :goods, :type, :kickers attr_accessor :winner def initialize(hand) @hand and @goods ] @folded alse @winner alse @type " end # Just sorts the goods def sortgoods @goods goods.flatten.sort { |x, y| $values[x[0].chr] <