From: "Hal E. Fulton" Date: 2002-08-08T16:11:36+09:00 Subject: Re: A very small challenge ----- Original Message ----- From: "Dave Thomas" To: "ruby-talk ML" Sent: Wednesday, August 07, 2002 10:19 PM Subject: Re: A very small challenge Replying again on this one. You made the breakthrough for me. But I was thinking in terms of true/false, and I also implemented the cards a little differently. The concept of a round as an object wasn't compelling enough to me personally. This is how I ended up doing it. class Card # (snip) def beats(other) if @suit == other.suit Ranks.index(@rank) > Ranks.index(other.rank) elsif @suit == "S" true else false end end end class Driver # (snip) def Driver.winner(cards) high = cards[0] cards[1..3].each {|card| high=card if card.beats(high) } high end end Ciao, Hal