https://github.com/kanevk/poker-engine
Horizontally scalable, immutable, and thread-safe poker library written in Ruby.
https://github.com/kanevk/poker-engine
card-game game-engine game-logic holdem holdem-poker poker poker-engine poker-hands poker-library ruby
Last synced: 3 months ago
JSON representation
Horizontally scalable, immutable, and thread-safe poker library written in Ruby.
- Host: GitHub
- URL: https://github.com/kanevk/poker-engine
- Owner: kanevk
- License: mit
- Created: 2017-09-29T20:44:00.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2023-07-16T06:33:40.000Z (over 2 years ago)
- Last Synced: 2025-06-28T16:03:54.964Z (4 months ago)
- Topics: card-game, game-engine, game-logic, holdem, holdem-poker, poker, poker-engine, poker-hands, poker-library, ruby
- Language: Ruby
- Homepage:
- Size: 219 KB
- Stars: 11
- Watchers: 2
- Forks: 2
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Poker Engine
Horizontally scalable, immutable, and thread-safe poker library written in Ruby,
utilizing the [Redux design pattern](https://redux.js.org/recipes/structuring-reducers/structuring-reducers#structuring-reducers)
and [Persistent data structures](https://en.wikipedia.org/wiki/Persistent_data_structure).
## Example
There is a simple console interface that you can run `./examples/simple-gameplay.rb` and play against yourself!
Valid moves:
- check
- fold
- call
- raise [bet amount], example: __raise 100__
## Documentation
You can think about the `PokerEngine::Game` like for a state machine. You can initiate it with `.start` and you can transition from one state in another with `.next`.
For more info check you can check the [console example](./examples/simple-gameplay.rb) or the [integration spec](./spec/integration_spec.rb).
## Setup
1. Make sure you have Ruby and bundler installed
2. Clone the repo
```shell
git clone git@github.com:kanevk/poker-engine.git
```
3. Install the dependencies
```shell
bundle
```
4. Run tests
```shell
bundle exec rspec -fd
```