poker_odds 0.1.0 → 0.1.3

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
  SHA256:
3
- metadata.gz: b574857f4d6fad3bc14ee60f4d4b2bc41efdc38b61709615a55542bfb3423d62
4
- data.tar.gz: 7ec770adceb40755ef8246f5964c2f308bb1df7572067a71949d0feca0190480
3
+ metadata.gz: 0f051198b6ad06d450eed6de84d7144e29f8799613a4b3afa9e51efcb361a79e
4
+ data.tar.gz: 66e2a399060eba110e929582245c50ae6e654bb8c7efa8484e02a22cb71e5fe1
5
5
  SHA512:
6
- metadata.gz: 4fa5bd0bee8b6baf898b8988baba6de6a053939d9c49a98f49956f1dfc9f79558825aad78ff22bc5a997847414324ac9ee36258d1f173b4e2b65f7fb1eb652b3
7
- data.tar.gz: 9e747a262df44ccc21e930a92ac58b115977bd2ca07cbca61db22711befda0bba24f5e0658d042ad758378b4d59ed4b1c017f0043814ecb7176895058ca0d07b
6
+ metadata.gz: 625b416f0687fcd883a399aeab7e6130453eb935450174ffef7aeb284b7a1e9742f7bdde89a58b717d635b8404176d60f04f619740dff4f028822ffaf641acf3
7
+ data.tar.gz: 107664dcfa0b07d0da2c608bf56e740b5f59ab12c3ad75ebf5c25580f0780fe28c72ba2b8a14f0ae13d2475e31b44a8b26d8d08ab1e91abcf1b2d250721b6a16
@@ -80,16 +80,14 @@ 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[hand] = {}
87
+ h[hand][:win_rate] = win_rate
88
+ h[hand][:lose_rate] = z.count { |a,b| b[:lose_hands]&.include?(hand) } / s
89
+ h[hand][:tie_rate] = z.count { |a,b| b[:tie_hands]&.include?(hand) } / s
90
+ h[hand][:outs] = win_hands.keys if win_rate < 0.5
93
91
  end
94
92
  end
95
93
 
@@ -1,3 +1,3 @@
1
1
  module PokerOdds
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.3"
3
3
  end
metadata CHANGED
@@ -1,11 +1,11 @@
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.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - kyohah
8
- autorequire:
8
+ autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
11
  date: 2022-07-07 00:00:00.000000000 Z
@@ -123,7 +123,7 @@ licenses:
123
123
  metadata:
124
124
  homepage_uri: https://github.com/kyohah/poker_odds
125
125
  source_code_uri: https://github.com/kyohah/poker_odds
126
- post_install_message:
126
+ post_install_message:
127
127
  rdoc_options: []
128
128
  require_paths:
129
129
  - lib
@@ -138,8 +138,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
138
138
  - !ruby/object:Gem::Version
139
139
  version: '0'
140
140
  requirements: []
141
- rubygems_version: 3.0.3.1
142
- signing_key:
141
+ rubygems_version: 3.2.32
142
+ signing_key:
143
143
  specification_version: 4
144
144
  summary: Write a short summary, because RubyGems requires one.
145
145
  test_files: []