rafanoronha / scala-poker

Having fun while coding a brand new open source scala poker library
MIT License
21 stars 12 forks source link

Implemented tie breaking rules #15 #38

Closed Naktibalda closed 10 years ago

Naktibalda commented 10 years ago

I implemented tie breaking rules, but how do I test equality of two hands?

rafanoronha commented 10 years ago

@Naktibalda have a look at https://github.com/scala/scala/blob/master/src/library/scala/math/Ordered.scala

 def >  (that: A): Boolean = (this compare that) >  0

Is just a syntactic sugar, so if I didn't miss anything it seems this is what you are looking for:

(diamondRoyalFlush compare clubRoyalFlush) should be(0)
Naktibalda commented 10 years ago

Hi, I am on holiday this week, I will look at it on Saturday. On 13 Jan 2014 18:51, "rafanoronha" notifications@github.com wrote:

@Naktibalda https://github.com/Naktibalda have a look at https://github.com/scala/scala/blob/master/src/library/scala/math/Ordered.scala

def > (that: A): Boolean = (this compare that) > 0

Is just a syntactic sugar, so if I didn't miss anything it seems this is what you are looking for:

(diamondRoyalFlush compare clubRoyalFlush) should be(0)

— Reply to this email directly or view it on GitHubhttps://github.com/rafanoronha/scala-poker/pull/38#issuecomment-32193043 .

Naktibalda commented 10 years ago

I implemented equals methods and hands can be compared with hand1 should equal(hand2)