poker_odds 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b574857f4d6fad3bc14ee60f4d4b2bc41efdc38b61709615a55542bfb3423d62
4
- data.tar.gz: 7ec770adceb40755ef8246f5964c2f308bb1df7572067a71949d0feca0190480
3
+ metadata.gz: 727beb1f40c45f4ab9b77d0a2b7c21da81b8fc8105414f516fdb04bed4e4bded
4
+ data.tar.gz: 107c85dabd7f0c4a68900fef7fe91e1d55604422e58403d5b95dfc3323838478
5
5
  SHA512:
6
- metadata.gz: 4fa5bd0bee8b6baf898b8988baba6de6a053939d9c49a98f49956f1dfc9f79558825aad78ff22bc5a997847414324ac9ee36258d1f173b4e2b65f7fb1eb652b3
7
- data.tar.gz: 9e747a262df44ccc21e930a92ac58b115977bd2ca07cbca61db22711befda0bba24f5e0658d042ad758378b4d59ed4b1c017f0043814ecb7176895058ca0d07b
6
+ metadata.gz: 41eecbb09877d4da4e99adacacb539f620b3616ace9584ad8c6cdc0a5d952b2db48e33f6b34fbecf4b36c8e9a0300541762c43ddf77871f4e9ffc848eaab89f5
7
+ data.tar.gz: b0e379b966eab71eb0d1eddac1f43cc54ff59f2357daf7f371598a8467b77d8da6ed63a6581685bf2c1cd9ad7cb4341a686df68c6d2147fa2d3bb231a196a1ab
@@ -80,16 +80,15 @@ module PokerOdds
80
80
 
81
81
  s = z.size.to_f
82
82
 
83
- hands.each_with_object([]) do |hand, a|
83
+ hands.each_with_object({}) do |hand, h|
84
84
  win_hands = z.select { |a,b| b[:win_hands]&.include?(hand) }
85
85
  win_rate = win_hands.size / s
86
- a << {
87
- hand: hand,
88
- win_rate: win_rate,
89
- lose_rate: z.count { |a,b| b[:lose_hands]&.include?(hand) } / s,
90
- tie_rate: z.count { |a,b| b[:tie_hands]&.include?(hand) } / s,
91
- outs: win_rate > 0.5 ? [] : win_hands.keys
92
- }
86
+ h = {}
87
+ h[:hand] = hand
88
+ h[:win_rate] = win_rate
89
+ h[:lose_rate] = z.count { |a,b| b[:lose_hands]&.include?(hand) } / s
90
+ h[:tie_rate] = z.count { |a,b| b[:tie_hands]&.include?(hand) } / s
91
+ h[:outs] = win_hands.keys if win_rate > 0.5
93
92
  end
94
93
  end
95
94
 
@@ -1,3 +1,3 @@
1
1
  module PokerOdds
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: poker_odds
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyohah