Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/houen/PokerFace
Actionscript 3 poker hand strength evaluation library and OO wrappers
https://github.com/houen/PokerFace
Last synced: about 2 months ago
JSON representation
Actionscript 3 poker hand strength evaluation library and OO wrappers
- Host: GitHub
- URL: https://github.com/houen/PokerFace
- Owner: houen
- Archived: true
- Created: 2011-03-26T18:02:47.000Z (almost 14 years ago)
- Default Branch: master
- Last Pushed: 2011-03-26T18:19:23.000Z (almost 14 years ago)
- Last Synced: 2024-08-04T05:05:25.488Z (5 months ago)
- Language: ActionScript
- Homepage:
- Size: 345 KB
- Stars: 8
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.markdown
Awesome Lists containing this project
- awesome-actionscript-sorted - PokerFace - Actionscript 3 poker hand strength evaluation library and OO wrappers (Unsorted / Other API)
README
This [Actionscript Flash poker (5-card & Texas Hold’em)](http://blog.houen.net/actionscript-3-poker-hand-evaluator/ "Actionscript Flash poker (5-card & Texas Hold’em)") evaluator will evaluate more than 14,000 hands per second, with a size of around 6 kb. It also includes classes to wrap everything up nice and tight for convenience.
Starting from [this post](http://www.codingthewheel.com/archives/poker-hand-evaluator-roundup "Poker blog post") about poker hand evaluators, i converted the improved version of [Cactukev’s poker hand evaluator](http://www.suffecool.net/poker/evaluator.html "Cactukev’s poker hand evaluator") to AS3 some time ago, and wrapped it in some nice OO classes to make it easily accessible.
The OO classes include ways to handle a Deck of cards, a Dealer to draw cards from it, objects to represent a 5- and 7-card hand and compare strengths, and a Card class to make card strength and textual representation easy.
The straight dope is that I have tested it to evaluate approx. 2.6 mio. 5-card poker hands in 6.3 seconds, and 133 mio. 7-card poker hands in approx. 2.5 hours, or about 14.000 hands per second. The test evaluated the correct evaluation of all possible 5- and 7-card poker hands.
The tests were run on a 2.8 gHz Macbook Pro with 4Gb RAM*Included in the library*
source code
.swc binary
API reference
The test to evaluate that it runs correctly here (AIR application)*License:*
The original code i ported it from was released to the public domain, and is as such free to use, modify and redistribute.
I am releasing this code under the MIT license. License info is found in the source files.