rpoker 0.1.4 → 0.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 796e19ad9f806076d80c6b38cb37577a60fc2e48
4
- data.tar.gz: 0229718b26ac3c2faf86e9c5061eb575807f6684
3
+ metadata.gz: c38de72c7209d9280ba8c08edc0b9a3f41beef52
4
+ data.tar.gz: 3140cf09cf2fae0ef28f35a6e79ad6ef0cf90c68
5
5
  SHA512:
6
- metadata.gz: 5b5576b3369451d33a07d1cc19cee5301bf2957b149e45558238b6b567058b75ee7eb3e989df69726fb7b8209fb2c493bed40922f4f5d043af000d763ba69110
7
- data.tar.gz: 0102369e0d2c4e4020f3a8d0cbd1c84723aac6d3a60f9ca2be4c3cbeb0d58f0bbe0dab5998edcc2808f49545d6ba333713bbcbb54689d4888e7f0fad8de62e13
6
+ metadata.gz: c41334079288a636d2a65422768225131ccfe1ec62859d303c4c02d5472f49f50d3af6c6a36b1984126867005655b8032b4c28f6bd685b12915bb2fe0f8b8c1c
7
+ data.tar.gz: cdbf384c2c032ecb4f18a9341cbe62590c372a3187bf8b4fb205fd24e8723c9916b690423e1869b6c50d72704a9fe2ea573709b7c1271caf22b45b064e862ba7
@@ -20,10 +20,7 @@ class Hand
20
20
  end
21
21
 
22
22
  def <=>(other_hand)
23
- winner = Matchup.new(self, other_hand).winner
24
- return 1 if winner == self
25
- return 0 if winner == nil
26
- return -1 if winner == other_hand
23
+ Matchup.new(self, other_hand).winner
27
24
  end
28
25
 
29
26
  def rank
@@ -5,8 +5,8 @@ class Matchup
5
5
  end
6
6
 
7
7
  def winner
8
- return hand1 if hand1.rank_idx < hand2.rank_idx
9
- return hand2 if hand2.rank_idx < hand1.rank_idx
8
+ return 1 if hand1.rank_idx < hand2.rank_idx
9
+ return -1 if hand2.rank_idx < hand1.rank_idx
10
10
  same_rank_winner
11
11
  end
12
12
 
@@ -18,9 +18,9 @@ class Matchup
18
18
  value_pairs = hand1.card_values.zip(hand2.card_values)
19
19
 
20
20
  value_pairs.each do |v1, v2|
21
- return hand1 if v1 > v2
22
- return hand2 if v2 > v1
21
+ return 1 if v1 > v2
22
+ return -1 if v2 > v1
23
23
  end
24
- nil
24
+ 0
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rpoker
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.4
4
+ version: 0.1.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Cornelis