All Projects → ChrisZieba → holdem

ChrisZieba / holdem

Licence: MIT license
A texas holdem simulator build with WebAssembly and web workers

Programming Languages

C++
36643 projects - #6 most used programming language
HTML
75241 projects
javascript
184084 projects - #8 most used programming language
c
50402 projects - #5 most used programming language
CSS
56736 projects
Makefile
30231 projects

Projects that are alternatives of or similar to holdem

Poker
Fully functional Pokerbot that works on PartyPoker and PokerStars, scraping tables with Open-CV (adaptable via gui) and making decisions based on a genetic algorithm and montecarlo simulation for poker equity calculation. Binaries can be downloaded with this link:
Stars: ✭ 873 (+1978.57%)
Mutual labels:  poker
Skpokereval
7-card Texas Hold'em hand evaluator
Stars: ✭ 193 (+359.52%)
Mutual labels:  poker
texas-poker-engine
Dummy Texas Poker Engine open source edition
Stars: ✭ 4 (-90.48%)
Mutual labels:  poker
Pokr
Make agile estimating and planning easy with our online planning or scrum poker tool
Stars: ✭ 44 (+4.76%)
Mutual labels:  poker
Pluribus
Implementation of Pluribus by Noam Brown & Tuomas Sandholm, a Superhuman AI for 6-MAX No-Limit Holdem Poker Bot.
Stars: ✭ 92 (+119.05%)
Mutual labels:  poker
Pokerrl
Framework for Multi-Agent Deep Reinforcement Learning in Poker
Stars: ✭ 214 (+409.52%)
Mutual labels:  poker
Casino Server
🔥 An online poker game server powered by Redis, node.js and socket.io
Stars: ✭ 721 (+1616.67%)
Mutual labels:  poker
easyPokerHUD
This is the official repository for easyPokerHUD.
Stars: ✭ 40 (-4.76%)
Mutual labels:  poker
Deep Cfr
Scalable Implementation of Deep CFR and Single Deep CFR
Stars: ✭ 158 (+276.19%)
Mutual labels:  poker
pluribus-hand-parser
Parsing the hand histories that poker AI Pluribus played
Stars: ✭ 54 (+28.57%)
Mutual labels:  poker
Node Poker Odds Calculator
A pre-flop and post-flop odds calculator for Texas Holdem.
Stars: ✭ 48 (+14.29%)
Mutual labels:  poker
Pypokergui
GUI application for PyPokerEngine
Stars: ✭ 72 (+71.43%)
Mutual labels:  poker
Casinosclient
果派德州客户端源代码,使用Unity3D引擎。
Stars: ✭ 217 (+416.67%)
Mutual labels:  poker
Rlcard
Reinforcement Learning / AI Bots in Card (Poker) Games - Blackjack, Leduc, Texas, DouDizhu, Mahjong, UNO.
Stars: ✭ 980 (+2233.33%)
Mutual labels:  poker
poinz
Distributed Planning Poker
Stars: ✭ 105 (+150%)
Mutual labels:  poker
Casino Holdem
PHP 7+ Texas Holdem extension to Cysha/Casino
Stars: ✭ 17 (-59.52%)
Mutual labels:  poker
Qnmahjongserver
房卡麻将棋牌解决方案
Stars: ✭ 196 (+366.67%)
Mutual labels:  poker
poker-calculator
Poker calculator for Texas Hold’em
Stars: ✭ 22 (-47.62%)
Mutual labels:  poker
bet
This repository holds the implementation code of Pangea Poker white paper: https://bit.ly/3bdCz0Z
Stars: ✭ 15 (-64.29%)
Mutual labels:  poker
Poker
Poker framework for Python
Stars: ✭ 248 (+490.48%)
Mutual labels:  poker

holdem

Build Status

holdem is a heads-up (2 player) Texas Hold'em simulator for hand ranges. It allows you to quickly calculate the total equity of your hand vs. a range of opponent hands. The simulations are calculated using C++ via WebAssembly using up to 8 web workers in parallel. This is pretty bare bones as far as range evaluators go, and there are many improvements I would like to make if I hade more time, see below.

MoodFuse

Demo

http://chriszieba.com/2017/11/26/holdem

Installing

make wasm

Calling make will place the compiled wasm and a javascript "glue" file into the /build directory. You can then include those files on a webserver and just open the index.html page to get up and running.

FAQ

  • Why did you make this?

    I put this together as a weekend project to learn more about WebAssembly.

  • What's a simulation?

    A simulation plays a hand out as if the players are all in and no action is left. For example, if the board only has 3 cards (flop) and you run the simulation, the board will complete (turn and river) for every possible combination of hands in the oppoopenet range vs. the hero hand.

  • What does this use to compile to wasm?

    emscripten

  • Why don't you use the --proxy-to-worker option from emscripten?

    I tried using this flag, but the .js file it produced was quite large and I could not get the message passing to work to the main thread.

  • Why doesn't this use a faster library for hand comparisons?

    There are many great options for an extrememly fast 7-card hand evaluator, but they all come with a large pre-computed table. Using a pre-computed table of values requires a large download (~100mb) before the app can be run, is not a great option for a web facing product. The speed difference between the library used in this app and other more well known libraries is not significant enough to justify the huge table downloads.

  • How many simulations can this run?

    Depends on the system architecture, but with 8 workers it should run about 20 million simulations a second.

  • What browsers does this work on?

    So far, I've tested on the following browsers

    • FireFox 57 (Mac OS 10, Ubuntu 16.04, Windows 10)
    • Chrome 61 (Mac OS 10, Windows 10, Android 6)
    • Safari 11 (Mac OS 10)
    • Microsoft Edge 16 (Windows 10)

Tests

make tests

Improvements

This was a weekend project for me, and as such a lot of corners were cut. If I had more time I would go back and improve a lot of things.

  • Faster card selector (remove select drop downs)

  • Better way to select multiple ranges (click & drag to highlight multiple cells)

  • Would like to add a lib like react to handle the state changes, and remove all the event listeners everywhere

  • Use SIDE_MODULE to load wasm as side module

  • Loading the wasm is currently not optimal, a much better apprach would be to compile the wasmm and pass the bytes into the worker, something like this

       fetch('go.wasm').then(response =>
         response.arrayBuffer()
       ).then(bytes =>
         WebAssembly.compile(bytes)
       ).then(mod => {
         worker1.postMessage(mod);
         worker2.postMessage(mod);
       });
    
  • As far as I know, WASM does not support pthreads (although there seem to be some emccflgas realted to it) but it would be nice if theC++` futures async library could be used as a possible replacement for web workers. The simulation code could then be changed to something like this:

      std::vector<std::future<int>> futures;
    
      for (int i = 0; i < COMBOS; i+=1) {
        futures.push_back (std::async([]() {
          // Run the simulation loop in new thread for each hand combination
        } , heroCards[0], ...));
      }
    
      for(auto &e : futures) std::cout << e.get() << std::endl;
    
  • better data transfering between workers, use of sharedArray

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].