Giter Site home page Giter Site logo

pptparser's Introduction

pptparser

Parse ProPokerTools style Pot-Limit Omaha hand range syntax

Installation

Numpy must be installed. The program has only been tested in Python 3.5 and 3.6.

Use

Call the 'evaluate' function in the RangeParserMasks script with a range of hands in the style of the syntax used by the ProPokerTools software, and optionally a board (Example: AdKhQc), or a numpy mask of impossible hands from a previously generated hand range.

The function will return an array of shape (n,4), with each row corresponding to a unique hand in this range.

The cards are represented with integers 1-52, corresponding to their index+1 in the following array

cardIndexes = ['2H','3H','4H','5H','6H','7H','8H','9H','TH','JH','QH','KH','AH',
               '2D','3D','4D','5D','6D','7D','8D','9D','TD','JD','QD','KD','AD',
               '2C','3C','4C','5C','6C','7C','8C','9C','TC','JC','QC','KC','AC',
               '2S','3S','4S','5S','6S','7S','8S','9S','TS','JS','QS','KS','AS']

The function will also return a mask of the hands that were found, hands are matched against the pptRankedHUnums.npy file. This mask enables quicker calculations of subranges, for example instead of typing AA:xxyz, if you already had the mask for xxyz saved in the variable 'myMask', you could call evaluate('AA',None,myMask), and this use the known information about the 'xxyz' range and calculate 'AA:xxyz'

Inconsistencies with ProPokerTools ranges

In rare cases where I believe ProPokerTools is inconsistent with their syntax, different ranges will be returned by this program.

Two examples: [2c,3c,4c,5c,6c]xxx will return AcKcQc2c, while [2c-6c]xxx will not include that hand. Given that the general case is for suit variables to match with bracketed ranges, in both situations AcKcQc2c will not be included here.

[33-]RR will include 2222, while [22-]RR will not include that hand. The general behavior is for rank variables to not match with bracketed ranges, so in both cases 2222 would be returned here.

License

Released under the MIT license.

pptparser's People

Contributors

tredfern0 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.