Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bencornelis/rpoker
A Ruby poker library
https://github.com/bencornelis/rpoker
rspec ruby
Last synced: about 1 month ago
JSON representation
A Ruby poker library
- Host: GitHub
- URL: https://github.com/bencornelis/rpoker
- Owner: bencornelis
- Created: 2015-09-18T02:17:07.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-10-28T19:30:39.000Z (over 7 years ago)
- Last Synced: 2024-04-29T02:43:10.383Z (10 months ago)
- Topics: rspec, ruby
- Language: Ruby
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
### rpoker
A ruby library for comparing and ranking poker hands.
### Install
```
gem install rpoker
```### Comparing hands
```ruby
hand1 = Hand.new("Ac Qh Jd Jh Qs")
hand2 = Hand.new(["2s", "3s", "5s", "4s", "As"])hand1 < hand2
# => true
```### Ranking hands
```ruby
hand1.rank
# => :two_pair
hand2.rank
# => :straight_flush
```
### SpecsTo run rspec specs:
```
rake
```To run a more comprehensive test for the ranking of over a million hands, first download the dataset using:
```
wget -P ./spec/fixtures http://archive.ics.uci.edu/ml/machine-learning-databases/poker/poker-hand-testing.data
```Then run:
```
rake integration
````