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 +4 -4
- data/lib/poker_odds/round.rb +7 -8
- data/lib/poker_odds/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 727beb1f40c45f4ab9b77d0a2b7c21da81b8fc8105414f516fdb04bed4e4bded
|
4
|
+
data.tar.gz: 107c85dabd7f0c4a68900fef7fe91e1d55604422e58403d5b95dfc3323838478
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 41eecbb09877d4da4e99adacacb539f620b3616ace9584ad8c6cdc0a5d952b2db48e33f6b34fbecf4b36c8e9a0300541762c43ddf77871f4e9ffc848eaab89f5
|
7
|
+
data.tar.gz: b0e379b966eab71eb0d1eddac1f43cc54ff59f2357daf7f371598a8467b77d8da6ed63a6581685bf2c1cd9ad7cb4341a686df68c6d2147fa2d3bb231a196a1ab
|
data/lib/poker_odds/round.rb
CHANGED
@@ -80,16 +80,15 @@ module PokerOdds
|
|
80
80
|
|
81
81
|
s = z.size.to_f
|
82
82
|
|
83
|
-
hands.each_with_object(
|
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
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
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
|
|
data/lib/poker_odds/version.rb
CHANGED