├── debian ├── compat ├── pycompat ├── .svn │ ├── text-base │ │ ├── compat.svn-base │ │ ├── pycompat.svn-base │ │ ├── control.breezy.svn-base │ │ ├── control.dapper.svn-base │ │ ├── control.hoary.svn-base │ │ ├── control.sarge.svn-base │ │ ├── control.edgy.svn-base │ │ ├── control.hardy.svn-base │ │ ├── control.intrepid.svn-base │ │ ├── control.jaunty.svn-base │ │ ├── control.feisty.svn-base │ │ ├── control.gutsy.svn-base │ │ ├── control.lenny.svn-base │ │ ├── control.etch.svn-base │ │ ├── control.svn-base │ │ ├── control.squeeze.svn-base │ │ ├── control.unstable.svn-base │ │ ├── copyright.svn-base │ │ ├── rules.svn-base │ │ └── changelog.svn-base │ ├── prop-base │ │ ├── changelog.svn-base │ │ ├── compat.svn-base │ │ ├── control.svn-base │ │ ├── copyright.svn-base │ │ ├── pycompat.svn-base │ │ ├── control.breezy.svn-base │ │ ├── control.dapper.svn-base │ │ ├── control.edgy.svn-base │ │ ├── control.etch.svn-base │ │ ├── control.hoary.svn-base │ │ ├── control.sarge.svn-base │ │ ├── control.unstable.svn-base │ │ └── rules.svn-base │ └── entries ├── control.breezy ├── control.dapper ├── control.hoary ├── control.sarge ├── control.hardy ├── control.intrepid ├── control.jaunty ├── control.edgy ├── control.feisty ├── control.gutsy ├── control.lenny ├── control.etch ├── control ├── control.squeeze ├── control.unstable ├── copyright ├── rules └── changelog ├── AUTHORS ├── MANIFEST ├── config ├── .svn │ ├── prop-base │ │ ├── python.m4.svn-base │ │ └── ccpython.m4.svn-base │ ├── entries │ └── text-base │ │ ├── ccpython.m4.svn-base │ │ └── python.m4.svn-base ├── ccpython.m4 └── python.m4 ├── gentoo ├── dev-games │ ├── pypoker-eval │ │ ├── .svn │ │ │ ├── prop-base │ │ │ │ └── pypoker-eval-133.0-r1.ebuild.svn-base │ │ │ ├── entries │ │ │ └── text-base │ │ │ │ └── pypoker-eval-133.0-r1.ebuild.svn-base │ │ └── pypoker-eval-133.0-r1.ebuild │ └── .svn │ │ └── entries └── .svn │ └── entries ├── pypoker-eval.pc.in ├── README ├── INSTALL.windows ├── .gitignore ├── NEWS ├── setup.py ├── pypoker-eval.sln ├── bug-1823.py ├── configure.ac ├── Makefile.am ├── pypoker-eval.vcproj ├── ChangeLog ├── test.py ├── pokereval.py ├── COPYING └── pypokereval.c /debian/compat: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /debian/pycompat: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /AUTHORS: -------------------------------------------------------------------------------- 1 | Loic Dachary 2 | -------------------------------------------------------------------------------- /debian/.svn/text-base/compat.svn-base: -------------------------------------------------------------------------------- 1 | 4 2 | -------------------------------------------------------------------------------- /debian/.svn/text-base/pycompat.svn-base: -------------------------------------------------------------------------------- 1 | 2 2 | -------------------------------------------------------------------------------- /MANIFEST: -------------------------------------------------------------------------------- 1 | # file GENERATED by distutils, do NOT edit 2 | README 3 | pypokereval.c 4 | setup.py 5 | -------------------------------------------------------------------------------- /config/.svn/prop-base/python.m4.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/changelog.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/compat.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/copyright.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/pycompat.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /config/.svn/prop-base/ccpython.m4.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.breezy.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.dapper.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.edgy.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.etch.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.hoary.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.sarge.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/control.unstable.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /debian/.svn/prop-base/rules.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 14 6 | svn:executable 7 | V 1 8 | * 9 | K 12 10 | svn:keywords 11 | V 23 12 | Author Date Id Revision 13 | END 14 | -------------------------------------------------------------------------------- /gentoo/dev-games/pypoker-eval/.svn/prop-base/pypoker-eval-133.0-r1.ebuild.svn-base: -------------------------------------------------------------------------------- 1 | K 13 2 | svn:eol-style 3 | V 6 4 | native 5 | K 12 6 | svn:keywords 7 | V 23 8 | Author Date Id Revision 9 | END 10 | -------------------------------------------------------------------------------- /pypoker-eval.pc.in: -------------------------------------------------------------------------------- 1 | # pkg-config source file 2 | 3 | prefix=@prefix@ 4 | exec_prefix=@exec_prefix@ 5 | 6 | Name: pypoker-eval 7 | Description: python adaptor for the poker-eval toolkit 8 | Version: @PACKAGE_VERSION@ 9 | Conflicts: 10 | -------------------------------------------------------------------------------- /gentoo/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 6581 5 | svn://svn.gna.org/svn/pokersource/trunk/pypoker-eval/gentoo 6 | svn://svn.gna.org/svn/pokersource 7 | 8 | 9 | 10 | 2006-11-20T16:39:46.000000Z 11 | 1888 12 | cpinson 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c4f34931-41c7-4605-b615-9bb9f479c57e 28 | 29 | dev-games 30 | dir 31 | 32 | -------------------------------------------------------------------------------- /gentoo/dev-games/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 6581 5 | svn://svn.gna.org/svn/pokersource/trunk/pypoker-eval/gentoo/dev-games 6 | svn://svn.gna.org/svn/pokersource 7 | 8 | 9 | 10 | 2006-11-20T16:39:46.000000Z 11 | 1888 12 | cpinson 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c4f34931-41c7-4605-b615-9bb9f479c57e 28 | 29 | pypoker-eval 30 | dir 31 | 32 | -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | What is pypoker-eval ? 2 | 3 | This package is python adaptor for the poker-eval toolkit for writing 4 | programs which simulate or analyze poker games as found at 5 | http://gna.org/projects/pokersource/. The python interface is 6 | somewhat simpler than the C API of poker-eval. It assumes that the 7 | caller is willing to have a higher level API and is not interested in 8 | a one to one mapping of the poker-eval API. 9 | 10 | For more information about the functions provided, check the 11 | documentation of the PokerEval class in the pokereval.py file. 12 | 13 | Loic Dachary 14 | -------------------------------------------------------------------------------- /INSTALL.windows: -------------------------------------------------------------------------------- 1 | pypoker-eval on Windows 2 | 3 | 1. install python 4 | 5 | 2. open visual studio project and change directories to include python directories and fix the path to the poker-eval project 6 | 7 | 3. build the project, there may be an undefined ssize you can typedef as int 8 | 9 | 4. locate the newly built dll pypokereval.dll then look at the exports and you will find something similar to init_pokereval_2_4 10 | 11 | 5. rename the dll to _pokereval_2_4.pyd (your version numbers) and move it into the test.py directory 12 | 13 | 6. edit the .py files so the imported module is _pokereval_2_4 (your version numbers) not a dynamically generated one 14 | -------------------------------------------------------------------------------- /gentoo/dev-games/pypoker-eval/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 6581 5 | svn://svn.gna.org/svn/pokersource/trunk/pypoker-eval/gentoo/dev-games/pypoker-eval 6 | svn://svn.gna.org/svn/pokersource 7 | 8 | 9 | 10 | 2006-11-20T16:39:46.000000Z 11 | 1888 12 | cpinson 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c4f34931-41c7-4605-b615-9bb9f479c57e 28 | 29 | pypoker-eval-133.0-r1.ebuild 30 | file 31 | 32 | 33 | 34 | 35 | 2011-11-27T16:20:07.084123Z 36 | fdee0b42da5591f7ba60dd6fc3b66da6 37 | 2006-11-20T16:39:29.000000Z 38 | 1886 39 | cpinson 40 | has-props 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 644 62 | 63 | -------------------------------------------------------------------------------- /debian/control.breezy: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.dapper: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.hoary: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.sarge: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.breezy.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.dapper.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.hoary.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.sarge.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-dev, automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.hardy: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.intrepid: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.jaunty: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /gentoo/dev-games/pypoker-eval/pypoker-eval-133.0-r1.ebuild: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2005 Gentoo Foundation 2 | # Distributed under the terms of the GNU General Public License v2 3 | # $Header$ 4 | 5 | inherit eutils 6 | 7 | DESCRIPTION="python binding for poker-eval" 8 | HOMEPAGE="http://gna.org/projects/pokersource" 9 | MY_P="${PN}-${PV}.tar.gz" 10 | SRC_URI="http://download.gna.org/pokersource/sources/${MY_P}" 11 | SLOT="0" 12 | LICENSE="GPL-2.1" 13 | KEYWORDS="x86 amd64" 14 | IUSE="" 15 | 16 | DEPEND="dev-games/poker-eval virtual/python" 17 | 18 | src_unpack() { 19 | unpack ${MY_P} 20 | if ls ${FILESDIR}/${PVR}*.patch 2>/dev/null 21 | then 22 | for i in ${FILESDIR}/${PVR}*.patch 23 | do 24 | epatch $i 25 | done 26 | fi 27 | } 28 | 29 | 30 | src_install () { 31 | make install DESTDIR=${D} || die "einstall failed" 32 | } 33 | -------------------------------------------------------------------------------- /debian/control.edgy: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.feisty: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.gutsy: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.lenny: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.7.2 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/control.etch: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.7.2 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.edgy.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.hardy.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.intrepid.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.jaunty.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/control.squeeze: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/control.unstable: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /gentoo/dev-games/pypoker-eval/.svn/text-base/pypoker-eval-133.0-r1.ebuild.svn-base: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2005 Gentoo Foundation 2 | # Distributed under the terms of the GNU General Public License v2 3 | # $Header$ 4 | 5 | inherit eutils 6 | 7 | DESCRIPTION="python binding for poker-eval" 8 | HOMEPAGE="http://gna.org/projects/pokersource" 9 | MY_P="${PN}-${PV}.tar.gz" 10 | SRC_URI="http://download.gna.org/pokersource/sources/${MY_P}" 11 | SLOT="0" 12 | LICENSE="GPL-2.1" 13 | KEYWORDS="x86 amd64" 14 | IUSE="" 15 | 16 | DEPEND="dev-games/poker-eval virtual/python" 17 | 18 | src_unpack() { 19 | unpack ${MY_P} 20 | if ls ${FILESDIR}/${PVR}*.patch 2>/dev/null 21 | then 22 | for i in ${FILESDIR}/${PVR}*.patch 23 | do 24 | epatch $i 25 | done 26 | fi 27 | } 28 | 29 | 30 | src_install () { 31 | make install DESTDIR=${D} || die "einstall failed" 32 | } 33 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.feisty.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.gutsy.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 4.0.0), cdbs, python-central, python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.6.1.1 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | 20 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.lenny.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.7.2 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.etch.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0), g++ 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.7.2 8 | 9 | Package: python-pypoker-eval 10 | Section: libs 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.squeeze.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake1.9, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /debian/.svn/text-base/control.unstable.svn-base: -------------------------------------------------------------------------------- 1 | Source: pypoker-eval 2 | Section: libs 3 | Priority: optional 4 | Maintainer: Loic Dachary (OuoU) 5 | Build-Depends: debhelper (>= 5.0.37.2), cdbs, python-central (>= 0.4.17), python-all-dev (>= 2.3.5-11), automake, libtool, pkg-config, libpoker-eval-dev (>= 124.0) 6 | XS-Python-Version: >= 2.3 7 | Standards-Version: 3.8.1 8 | 9 | Package: python-pypoker-eval 10 | Section: python 11 | Architecture: any 12 | Depends: ${shlibs:Depends}, ${python:Depends}, ${misc:Depends} 13 | XB-Python-Version: ${python:Versions} 14 | Provides: ${python:Provides} 15 | Conflicts: python2.3-pypoker-eval (<< 132.0), python2.4-pypoker-eval (<< 132.0) 16 | Description: python interface to poker hand evaluator library development files 17 | This package is a free (GPL) toolkit for writing programs which 18 | simulate or analyze poker games. 19 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | *.egg-info/ 24 | .installed.cfg 25 | *.egg 26 | 27 | # PyInstaller 28 | # Usually these files are written by a python script from a template 29 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 30 | *.manifest 31 | *.spec 32 | 33 | # Installer logs 34 | pip-log.txt 35 | pip-delete-this-directory.txt 36 | 37 | # Unit test / coverage reports 38 | htmlcov/ 39 | .tox/ 40 | .coverage 41 | .coverage.* 42 | .cache 43 | nosetests.xml 44 | coverage.xml 45 | *,cover 46 | 47 | # Translations 48 | *.mo 49 | *.pot 50 | 51 | # Django stuff: 52 | *.log 53 | 54 | # Sphinx documentation 55 | docs/_build/ 56 | 57 | # PyBuilder 58 | target/ 59 | -------------------------------------------------------------------------------- /config/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 6581 5 | svn://svn.gna.org/svn/pokersource/trunk/pypoker-eval/config 6 | svn://svn.gna.org/svn/pokersource 7 | 8 | 9 | 10 | 2008-12-25T20:49:24.665525Z 11 | 5340 12 | loic 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c4f34931-41c7-4605-b615-9bb9f479c57e 28 | 29 | python.m4 30 | file 31 | 32 | 33 | 34 | 35 | 2011-11-27T16:20:07.092123Z 36 | cb4a1a5600b2c8e28c60a845a7cf5fc8 37 | 2008-12-02T19:04:51.684279Z 38 | 5117 39 | bkuhn 40 | has-props 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 8763 62 | 63 | ccpython.m4 64 | file 65 | 66 | 67 | 68 | 69 | 2011-11-27T16:20:07.092123Z 70 | ced65950f4d62b788526a2851121ffaa 71 | 2008-12-25T20:49:24.665525Z 72 | 5340 73 | loic 74 | has-props 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 4646 96 | 97 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- 1 | * Release 138.0 2 | 3 | Bug fixes. 4 | 5 | * Release 137.0 6 | 7 | Debian packaging upgrades. 8 | Slight improvement in the documentation. 9 | 10 | * Release 136.0 11 | 12 | GPLv3+ license upgrade 13 | 14 | * Release 135.0 15 | 16 | Minor bug fixes. 17 | 18 | * Release 134.0 19 | 20 | Bug fixes. 21 | 22 | * Release 133.0 23 | 24 | Portability fixes. 25 | 26 | * Release 132.0 27 | 28 | Major repackaging (support multiple python version in a single package). 29 | 30 | * Release 131.0 31 | 32 | Minor compilation fixes. 33 | 34 | * Release 130.0 35 | 36 | Portability fixes (python2.2, redhat). 37 | 38 | * Release 129.0 39 | 40 | Portability fixes. 41 | 42 | * Release 128.0 43 | 44 | Rework build system and packages for distribution on python2.3 and python2.4 45 | 46 | Portability fixes. 47 | 48 | * Release 126.0 49 | 50 | Bug fixes. 51 | 52 | * Release 125.0 53 | 54 | RPM packages 55 | 56 | * Release 122.0 57 | 58 | Documentation 59 | 60 | * Release 121.0 61 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | This package was debianized by Loic Dachary (OuoU) on 2 | Sat, 21 Feb 2004 13:35:33 +0100. 3 | 4 | It was downloaded from http://gna.org/projects/pokersource 5 | 6 | Upstream Author: Loic Dachary 7 | 8 | Copyright 2008 Loic Dachary : 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | On Debian systems, the complete text of the GNU General 24 | Public License can be found in `/usr/share/common-licenses/GPL-3'. 25 | 26 | -------------------------------------------------------------------------------- /debian/.svn/text-base/copyright.svn-base: -------------------------------------------------------------------------------- 1 | This package was debianized by Loic Dachary (OuoU) on 2 | Sat, 21 Feb 2004 13:35:33 +0100. 3 | 4 | It was downloaded from http://gna.org/projects/pokersource 5 | 6 | Upstream Author: Loic Dachary 7 | 8 | Copyright 2008 Loic Dachary : 9 | 10 | This program is free software: you can redistribute it and/or modify 11 | it under the terms of the GNU General Public License as published by 12 | the Free Software Foundation, either version 3 of the License, or 13 | (at your option) any later version. 14 | 15 | This program is distributed in the hope that it will be useful, 16 | but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | GNU General Public License for more details. 19 | 20 | You should have received a copy of the GNU General Public License 21 | along with this program. If not, see . 22 | 23 | On Debian systems, the complete text of the GNU General 24 | Public License can be found in `/usr/share/common-licenses/GPL-3'. 25 | 26 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | #export DH_VERBOSE=1 5 | 6 | include /usr/share/cdbs/1/rules/debhelper.mk 7 | 8 | clean:: debian/stamp-autotools-configure 9 | rm -f $(DEB_SRCDIR)/*cdbs-* 10 | 11 | include /usr/share/cdbs/1/class/autotools.mk 12 | 13 | DEB_CONFIGURE_EXTRA_FLAGS = --enable-maintainer-mode --disable-static 14 | 15 | ifneq (ccache,$(findstring ccache,$(DEB_BUILD_OPTIONS))) 16 | DEB_CONFIGURE_EXTRA_FLAGS += --without-ccache 17 | endif 18 | 19 | DEB_MAKE_CLEAN_TARGET = maintainer-clean 20 | 21 | is_debug_package=$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),yes,) 22 | 23 | $(DEB_SRCDIR)/configure:: $(DEB_SRCDIR)/configure.ac 24 | autoreconf --install 25 | chmod a+x $@ 26 | 27 | # override in order to add dependency to configure (should be a :: rule instead of a : rule) 28 | debian/stamp-autotools-configure: $(DEB_SRCDIR)/configure 29 | chmod a+x $(DEB_CONFIGURE_SCRIPT) 30 | $(DEB_CONFIGURE_INVOKE) $(cdbs_configure_flags) $(DEB_CONFIGURE_EXTRA_FLAGS) $(DEB_CONFIGURE_USER_FLAGS) 31 | if [ -f /usr/bin/libtool ] ; then cp /usr/bin/libtool libtool ; fi 32 | 33 | common-install-arch:: 34 | find debian/python-pypoker-eval -name '*.la' | xargs rm 35 | 36 | binary-install/python-pypoker-eval:: 37 | -dh_pycentral -ppython-pypoker-eval 38 | dh_python -ppython-pypoker-eval 39 | -------------------------------------------------------------------------------- /debian/.svn/text-base/rules.svn-base: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | # -*- makefile -*- 3 | 4 | #export DH_VERBOSE=1 5 | 6 | include /usr/share/cdbs/1/rules/debhelper.mk 7 | 8 | clean:: debian/stamp-autotools-configure 9 | rm -f $(DEB_SRCDIR)/*cdbs-* 10 | 11 | include /usr/share/cdbs/1/class/autotools.mk 12 | 13 | DEB_CONFIGURE_EXTRA_FLAGS = --enable-maintainer-mode --disable-static 14 | 15 | ifneq (ccache,$(findstring ccache,$(DEB_BUILD_OPTIONS))) 16 | DEB_CONFIGURE_EXTRA_FLAGS += --without-ccache 17 | endif 18 | 19 | DEB_MAKE_CLEAN_TARGET = maintainer-clean 20 | 21 | is_debug_package=$(if $(findstring noopt,$(DEB_BUILD_OPTIONS)),yes,) 22 | 23 | $(DEB_SRCDIR)/configure:: $(DEB_SRCDIR)/configure.ac 24 | autoreconf --install 25 | chmod a+x $@ 26 | 27 | # override in order to add dependency to configure (should be a :: rule instead of a : rule) 28 | debian/stamp-autotools-configure: $(DEB_SRCDIR)/configure 29 | chmod a+x $(DEB_CONFIGURE_SCRIPT) 30 | $(DEB_CONFIGURE_INVOKE) $(cdbs_configure_flags) $(DEB_CONFIGURE_EXTRA_FLAGS) $(DEB_CONFIGURE_USER_FLAGS) 31 | if [ -f /usr/bin/libtool ] ; then cp /usr/bin/libtool libtool ; fi 32 | 33 | common-install-arch:: 34 | find debian/python-pypoker-eval -name '*.la' | xargs rm 35 | 36 | binary-install/python-pypoker-eval:: 37 | -dh_pycentral -ppython-pypoker-eval 38 | dh_python -ppython-pypoker-eval 39 | -------------------------------------------------------------------------------- /setup.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | from __future__ import with_statement 4 | 5 | import sys 6 | import os 7 | from distutils import core 8 | from distutils.core import Extension 9 | from distutils.command.build_ext import build_ext 10 | 11 | 12 | def read_file(name): 13 | dir_name = os.path.dirname(os.path.abspath(__file__)) 14 | file_name = os.path.join(dir_name, name) 15 | with open(file_name) as f_obj: 16 | return f_obj.read() 17 | 18 | PYTHON_VERSION = sys.version[0] + '_' + sys.version[2] 19 | C_NAME = '_pokereval_' + PYTHON_VERSION 20 | 21 | 22 | core.setup( 23 | name = 'pokereval', 24 | py_modules = ['pokereval'], 25 | version = '1.39', 26 | description = '', 27 | author = '', 28 | author_email = '', 29 | url = '', 30 | license = read_file('COPYING'), 31 | package_data = {'pokereval': ["README"]}, 32 | classifiers = [], 33 | ext_modules = [ 34 | Extension( 35 | C_NAME, 36 | ['pypokereval.c'], 37 | include_dirs = ['include', '/usr/local/include/poker-eval', '/usr/include/poker-eval'], 38 | libraries = ['poker-eval'], 39 | define_macros = [ 40 | ('PYTHON_VERSION', '"%s"' % PYTHON_VERSION), 41 | ('VERSION_NAME(w)', r'w ## ' + PYTHON_VERSION), 42 | ], 43 | ), 44 | ], 45 | ) 46 | 47 | -------------------------------------------------------------------------------- /pypoker-eval.sln: -------------------------------------------------------------------------------- 1 | Microsoft Visual Studio Solution File, Format Version 8.00 2 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "pythonpoker-eval", "pypoker-eval.vcproj", "{BCBF81C6-64CF-4826-BD58-6879D92295FB}" 3 | ProjectSection(ProjectDependencies) = postProject 4 | {A4DEF05E-E072-493E-B282-84731D60BCF0} = {A4DEF05E-E072-493E-B282-84731D60BCF0} 5 | EndProjectSection 6 | EndProject 7 | Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "poker-eval", "..\poker-eval\poker-eval.vcproj", "{A4DEF05E-E072-493E-B282-84731D60BCF0}" 8 | ProjectSection(ProjectDependencies) = postProject 9 | EndProjectSection 10 | EndProject 11 | Global 12 | GlobalSection(SolutionConfiguration) = preSolution 13 | Debug = Debug 14 | profile = profile 15 | Release = Release 16 | EndGlobalSection 17 | GlobalSection(ProjectConfiguration) = postSolution 18 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.Debug.ActiveCfg = Debug|Win32 19 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.Debug.Build.0 = Debug|Win32 20 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.profile.ActiveCfg = Release|Win32 21 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.profile.Build.0 = Release|Win32 22 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.Release.ActiveCfg = Release|Win32 23 | {BCBF81C6-64CF-4826-BD58-6879D92295FB}.Release.Build.0 = Release|Win32 24 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.Debug.ActiveCfg = Debug|Win32 25 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.Debug.Build.0 = Debug|Win32 26 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.profile.ActiveCfg = profile|Win32 27 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.profile.Build.0 = profile|Win32 28 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.Release.ActiveCfg = Release|Win32 29 | {A4DEF05E-E072-493E-B282-84731D60BCF0}.Release.Build.0 = Release|Win32 30 | EndGlobalSection 31 | GlobalSection(ExtensibilityGlobals) = postSolution 32 | EndGlobalSection 33 | GlobalSection(ExtensibilityAddIns) = postSolution 34 | EndGlobalSection 35 | EndGlobal 36 | -------------------------------------------------------------------------------- /bug-1823.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007, 2008 Loic Dachary 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # http://gna.org/support/?1823 19 | # 20 | import sys 21 | sys.path.insert(0, ".") 22 | sys.path.insert(0, ".libs") 23 | 24 | from pokereval import PokerEval 25 | 26 | pokereval = PokerEval() 27 | 28 | result = pokereval.poker_eval(game = "holdem", fill_pockets = 1, pockets = [ ["As", "3s"], ["__", "__"]], dead = [], board = ["Ad", "Qs", "2c", "Ac", "Kc"]) 29 | assert result == {'info': (990, 0, 1), 'eval': [{'winlo': 0, 'tielo': 0, 'winhi': 877, 'scoop': 877, 'loselo': 0, 'ev': 903, 'losehi': 78, 'tiehi': 35}, {'winlo': 0, 'tielo': 0, 'winhi': 78, 'scoop': 78, 'loselo': 0, 'ev': 96, 'losehi': 877, 'tiehi': 35}]} 30 | 31 | result = pokereval.poker_eval(game = "omaha8", fill_pockets = 1, pockets = [ ["As", "3s", "2s", "6s"], ["__", "__", "__", "__"]], dead = [], board = ["Ad", "Qs", "2c", "7c", "5c"]) 32 | assert result == {'info': (123410, 1, 1), 'eval': [{'winlo': 109375, 'tielo': 5361, 'winhi': 73190, 'scoop': 69661, 'loselo': 8674, 'ev': 753, 'losehi': 48978, 'tiehi': 1242}, {'winlo': 8674, 'tielo': 5361, 'winhi': 48978, 'scoop': 8674, 'loselo': 68788, 'ev': 246, 'losehi': 73190, 'tiehi': 1242}]} 33 | 34 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007, 2008 Loic Dachary 3 | # Copyright (C) 2008 Bradley M. Kuhn 4 | # Copyright (C) 2004, 2005, 2006 Mekensleep 5 | # 24 rue vieille du temple, 75004 Paris 6 | # 7 | # 8 | # This program is free software; you can redistribute it and/or modify 9 | # it under the terms of the GNU General Public License as published by 10 | # the Free Software Foundation; either version 3 of the License, or 11 | # (at your option) any later version. 12 | # 13 | # This program is distributed in the hope that it will be useful, 14 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 | # GNU General Public License for more details. 17 | # 18 | # You should have received a copy of the GNU General Public License 19 | # along with this program; if not, write to the Free Software 20 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 21 | # 22 | # Authors: 23 | # Loic Dachary 24 | # Bradley M. Kuhn 25 | 26 | # Process this file with autoconf to produce a configure script. 27 | 28 | AC_PREREQ(2.54) 29 | AC_INIT(pypoker-eval, 138.0) 30 | AC_CONFIG_AUX_DIR(config) 31 | AC_CANONICAL_TARGET 32 | AM_INIT_AUTOMAKE() 33 | AC_CONFIG_SRCDIR([pypokereval.c]) 34 | 35 | # Checks for programs. 36 | AC_PROG_MAKE_SET 37 | AC_GNU_SOURCE 38 | AC_LANG(C) 39 | AC_PROG_CXX 40 | AC_PROG_LIBTOOL 41 | AC_PROG_RANLIB 42 | 43 | AC_CHECK_FUNCS([memset]) 44 | 45 | AM_MAINTAINER_MODE 46 | 47 | # Check for python 48 | # 49 | # GCC specific debug and optimization flags 50 | # 51 | AC_ARG_ENABLE(debug, 52 | [ --enable-debug build in debug mode (the default is to build in optimized mode)], 53 | [enable_debug=yes]) 54 | 55 | if test "$GCC" = "yes" -a "$ac_test_CFLAGS" != set ; then 56 | if test "$enable_debug" = "yes" ; then 57 | CFLAGS="-pipe -g -Wall -Wpointer-arith -Wstrict-prototypes" 58 | else 59 | CFLAGS="-pipe -O3 -Wall -Wpointer-arith -Wstrict-prototypes" 60 | fi 61 | fi 62 | 63 | test x$prefix = xNONE && prefix="$ac_default_prefix" 64 | test x$exec_prefix = xNONE && exec_prefix="$prefix" 65 | 66 | ALL_CC_PYTHON 67 | 68 | # Check for poker-eval 69 | PKG_CHECK_MODULES(POKER_EVAL, poker-eval >= 124.0) 70 | 71 | # Generate files 72 | AC_CONFIG_FILES([Makefile 73 | pypoker-eval.pc]) 74 | AC_OUTPUT 75 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007, 2008 Loic Dachary 3 | # Copyright (C) 2008 Bradley M. Kuhn 4 | # Copyright (C) 2004, 2005, 2006 Mekensleep 5 | # 24 rue vieille du temple, 75004 Paris 6 | # 7 | # This program is free software; you can redistribute it and/or modify 8 | # it under the terms of the GNU General Public License as published by 9 | # the Free Software Foundation; either version 3 of the License, or 10 | # (at your option) any later version. 11 | # 12 | # This program is distributed in the hope that it will be useful, 13 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 | # GNU General Public License for more details. 16 | # 17 | # You should have received a copy of the GNU General Public License 18 | # along with this program; if not, write to the Free Software 19 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 20 | # 21 | # Authors: 22 | # Loic Dachary 23 | # Bradley M. Kuhn 24 | # 25 | # 26 | ACLOCAL_AMFLAGS = -I config 27 | 28 | MAINTAINERCLEANFILES = INSTALL Makefile.in aclocal.m4 configure \ 29 | $(filter-out %.m4,$(wildcard config/[a-z]*)) 30 | 31 | pythondir = ${pyexecdir} 32 | python_PYTHON = \ 33 | pokereval.py 34 | 35 | if PYTHON_2_7 36 | py2_6exec_LTLIBRARIES = _pokereval_2_7.la 37 | _pokereval_2_7_la_SOURCES = pypokereval.c 38 | _pokereval_2_7_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 39 | _pokereval_2_7_la_LIBADD = ${PYTHON2_7_LIBS} ${POKER_EVAL_LIBS} 40 | _pokereval_2_7_la_CFLAGS = ${PYTHON2_7_CFLAGS} ${POKER_EVAL_CFLAGS} -DPYTHON_VERSION=\"2_7\" -D'VERSION_NAME(w)=w\#\#2_7' 41 | endif 42 | 43 | if PYTHON_2_6 44 | py2_6exec_LTLIBRARIES = _pokereval_2_6.la 45 | _pokereval_2_6_la_SOURCES = pypokereval.c 46 | _pokereval_2_6_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 47 | _pokereval_2_6_la_LIBADD = ${PYTHON2_6_LIBS} ${POKER_EVAL_LIBS} 48 | _pokereval_2_6_la_CFLAGS = ${PYTHON2_6_CFLAGS} ${POKER_EVAL_CFLAGS} -DPYTHON_VERSION=\"2_6\" -D'VERSION_NAME(w)=w\#\#2_6' 49 | endif 50 | 51 | if PYTHON_2_5 52 | py2_5exec_LTLIBRARIES = _pokereval_2_5.la 53 | _pokereval_2_5_la_SOURCES = pypokereval.c 54 | _pokereval_2_5_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 55 | _pokereval_2_5_la_LIBADD = ${PYTHON2_5_LIBS} ${POKER_EVAL_LIBS} 56 | _pokereval_2_5_la_CFLAGS = ${PYTHON2_5_CFLAGS} ${POKER_EVAL_CFLAGS} -DPYTHON_VERSION=\"2_5\" -D'VERSION_NAME(w)=w\#\#2_5' 57 | endif 58 | 59 | if PYTHON_2_4 60 | py2_4exec_LTLIBRARIES = _pokereval_2_4.la 61 | _pokereval_2_4_la_SOURCES = pypokereval.c 62 | _pokereval_2_4_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 63 | _pokereval_2_4_la_LIBADD = ${PYTHON2_4_LIBS} ${POKER_EVAL_LIBS} 64 | _pokereval_2_4_la_CFLAGS = ${PYTHON2_4_CFLAGS} ${POKER_EVAL_CFLAGS} -DPYTHON_VERSION=\"2_4\" -D'VERSION_NAME(w)=w\#\#2_4' 65 | endif 66 | 67 | if PYTHON_2_3 68 | py2_3exec_LTLIBRARIES = _pokereval_2_3.la 69 | _pokereval_2_3_la_SOURCES = pypokereval.c 70 | _pokereval_2_3_la_LDFLAGS = -module -no-undefined -version-info 1:0:0 71 | _pokereval_2_3_la_LIBADD = ${PYTHON2_3_LIBS} ${POKER_EVAL_LIBS} 72 | _pokereval_2_3_la_CFLAGS = ${PYTHON2_3_CFLAGS} ${POKER_EVAL_CFLAGS} -DPYTHON_VERSION=\"2_3\" -D'VERSION_NAME(w)=w\#\#2_3' 73 | endif 74 | 75 | pkgconfigdir = ${libdir}/pkgconfig 76 | pkgconfig_DATA = pypoker-eval.pc 77 | 78 | EXTRA_DIST = config/python.m4 config/ccpython.m4 \ 79 | test.py \ 80 | bug-1823.py \ 81 | pypoker-eval.vcproj pypoker-eval.sln \ 82 | INSTALL.windows \ 83 | $(wildcard gentoo/dev-games/pypoker-eval/*.ebuild) 84 | 85 | TESTS_ENVIRONMENT = ${PYTHON} 86 | TESTS = test.py bug-1823.py 87 | -------------------------------------------------------------------------------- /pypoker-eval.vcproj: -------------------------------------------------------------------------------- 1 | 2 | 9 | 10 | 12 | 13 | 14 | 20 | 37 | 39 | 52 | 54 | 56 | 58 | 60 | 62 | 64 | 66 | 68 | 70 | 72 | 73 | 79 | 95 | 97 | 109 | 111 | 113 | 115 | 117 | 119 | 121 | 123 | 125 | 127 | 129 | 130 | 131 | 132 | 133 | 134 | 137 | 139 | 140 | 141 | 144 | 145 | 148 | 149 | 150 | 151 | 152 | 153 | -------------------------------------------------------------------------------- /config/ccpython.m4: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2002, 2005, 2007, 2008 Loic Dachary 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ========================================================================= 19 | # MY_CC_PYTHON : Python checking macros 20 | 21 | AC_DEFUN([_ONE_CC_PYTHON], 22 | [ 23 | AM_PATH_PYTHON($1,[],[unset PYTHON]) 24 | have_python="no" 25 | if test "$PYTHON" ; then 26 | 27 | eval eval py]$2[execdir=${pyexecdir} 28 | AC_SUBST(py]$2[execdir) 29 | eval eval pkgpy]$2[execdir=${pkgpyexecdir} 30 | AC_SUBST(pkgpy]$2[execdir) 31 | 32 | AC_REQUIRE_CPP() 33 | 34 | AC_CACHE_CHECK([for $am_display_PYTHON$2 include directory], 35 | [am_cv_python]$2[_includedir], 36 | [am_cv_python]$2[_includedir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null || 37 | echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION"`]) 38 | AC_SUBST([python]$2[includedir], [$am_cv_python]$2[_includedir]) 39 | 40 | AC_CACHE_CHECK([for $am_display_PYTHON C libraries directory], 41 | [am_cv_python]$2[_clibdir], 42 | [am_cv_python]$2[_clibdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBPL')" 2>/dev/null || 43 | echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"`]) 44 | AC_SUBST([python]$2[clibdir], [$am_cv_python]$2[_clibdir]) 45 | 46 | AC_CACHE_CHECK([for $am_display_PYTHON link flags], 47 | [am_cv_python]$2[_linkflags], 48 | [ 49 | am_cv_python]$2[_linkflags=`$PYTHON -c "from distutils import sysconfig; print '-L' + sysconfig.get_config_var('LIBPL')" 2>/dev/null || echo "-L$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"` 50 | am_cv_python]$2[_linkflags="$am_cv_python]$2[_linkflags -lpython$PYTHON_VERSION" 51 | ]) 52 | AC_SUBST([python]$2[linkflags], [$am_cv_python]$2[_linkflags]) 53 | 54 | PYTHON_CFLAGS="-I$python]$2[includedir" 55 | PYTHON_LIBS="-L$python]$2[clibdir $python]$2[linkflags" 56 | 57 | _CPPFLAGS="$CPPFLAGS" 58 | CPPFLAGS="$CPPFLAGS ${PYTHON_CFLAGS}" 59 | 60 | echo checking python includes in $python]$2[includedir 61 | 62 | unset ac_cv_header_Python_h 63 | AC_CHECK_HEADER([Python.h], 64 | have_python_headers="yes", 65 | have_python_headers="no" ) 66 | 67 | dnl Test the libraries 68 | AC_MSG_CHECKING(for Python libraries) 69 | 70 | AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") 71 | 72 | CPPFLAGS="$_CPPFLAGS" 73 | 74 | if test "$have_python_libraries" = "yes" 75 | then 76 | if test "$python_libraries" 77 | then 78 | AC_MSG_RESULT([$python_libraries]) 79 | else 80 | AC_MSG_RESULT(yes) 81 | fi 82 | else 83 | AC_MSG_RESULT(no) 84 | fi 85 | 86 | if test "$have_python_headers" = "yes" \ 87 | && test "$have_python_libraries" = "yes" 88 | then 89 | have_python="yes" 90 | else 91 | have_python="no" 92 | fi 93 | 94 | if test "$have_python" = "no" 95 | then 96 | AC_MSG_WARN([No python compilation environment for $1]) 97 | else 98 | [PYTHON]$2[_CFLAGS]="${PYTHON_CFLAGS}" 99 | AC_SUBST([PYTHON]$2[_CFLAGS]) 100 | AC_SUBST(PYTHON_CFLAGS) 101 | 102 | [PYTHON]$2[_LIBS]="${PYTHON_LIBS}" 103 | AC_SUBST([PYTHON]$2[_LIBS]) 104 | AC_SUBST(PYTHON_LIBS) 105 | AC_MSG_NOTICE([Found working python compilation environment for $1]) 106 | fi 107 | fi 108 | AM_CONDITIONAL([PYTHON_]$2, [test "$have_python" != "no"]) 109 | ]) 110 | 111 | AC_DEFUN([ALL_CC_PYTHON], 112 | [ 113 | m4_define([_AM_PYTHON_INTERPRETER_LIST], [python2.6 python2.5 python2.4 python2.3]) 114 | PYTHONS='' 115 | found_one='' 116 | _ONE_CC_PYTHON([=2.3], [2_3]) 117 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 118 | unset PYTHON 119 | _ONE_CC_PYTHON([=2.4], [2_4]) 120 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 121 | unset PYTHON 122 | _ONE_CC_PYTHON([=2.5], [2_5]) 123 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 124 | unset PYTHON 125 | _ONE_CC_PYTHON([=2.6], [2_6]) 126 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 127 | PYTHON=$found_one 128 | if ! test "$found_one" ; then 129 | AC_MSG_ERROR([No python development environments found]) 130 | fi 131 | ]) 132 | -------------------------------------------------------------------------------- /config/.svn/text-base/ccpython.m4.svn-base: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2002, 2005, 2007, 2008 Loic Dachary 3 | # 4 | # This program is free software; you can redistribute it and/or modify 5 | # it under the terms of the GNU General Public License as published by 6 | # the Free Software Foundation; either version 3 of the License, or 7 | # (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License 15 | # along with this program; if not, write to the Free Software 16 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 17 | # 18 | # ========================================================================= 19 | # MY_CC_PYTHON : Python checking macros 20 | 21 | AC_DEFUN([_ONE_CC_PYTHON], 22 | [ 23 | AM_PATH_PYTHON($1,[],[unset PYTHON]) 24 | have_python="no" 25 | if test "$PYTHON" ; then 26 | 27 | eval eval py]$2[execdir=${pyexecdir} 28 | AC_SUBST(py]$2[execdir) 29 | eval eval pkgpy]$2[execdir=${pkgpyexecdir} 30 | AC_SUBST(pkgpy]$2[execdir) 31 | 32 | AC_REQUIRE_CPP() 33 | 34 | AC_CACHE_CHECK([for $am_display_PYTHON$2 include directory], 35 | [am_cv_python]$2[_includedir], 36 | [am_cv_python]$2[_includedir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('INCLUDEPY')" 2>/dev/null || 37 | echo "$PYTHON_PREFIX/include/python$PYTHON_VERSION"`]) 38 | AC_SUBST([python]$2[includedir], [$am_cv_python]$2[_includedir]) 39 | 40 | AC_CACHE_CHECK([for $am_display_PYTHON C libraries directory], 41 | [am_cv_python]$2[_clibdir], 42 | [am_cv_python]$2[_clibdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_config_var('LIBPL')" 2>/dev/null || 43 | echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"`]) 44 | AC_SUBST([python]$2[clibdir], [$am_cv_python]$2[_clibdir]) 45 | 46 | AC_CACHE_CHECK([for $am_display_PYTHON link flags], 47 | [am_cv_python]$2[_linkflags], 48 | [ 49 | am_cv_python]$2[_linkflags=`$PYTHON -c "from distutils import sysconfig; print '-L' + sysconfig.get_config_var('LIBPL')" 2>/dev/null || echo "-L$PYTHON_PREFIX/lib/python$PYTHON_VERSION/config"` 50 | am_cv_python]$2[_linkflags="$am_cv_python]$2[_linkflags -lpython$PYTHON_VERSION" 51 | ]) 52 | AC_SUBST([python]$2[linkflags], [$am_cv_python]$2[_linkflags]) 53 | 54 | PYTHON_CFLAGS="-I$python]$2[includedir" 55 | PYTHON_LIBS="-L$python]$2[clibdir $python]$2[linkflags" 56 | 57 | _CPPFLAGS="$CPPFLAGS" 58 | CPPFLAGS="$CPPFLAGS ${PYTHON_CFLAGS}" 59 | 60 | echo checking python includes in $python]$2[includedir 61 | 62 | unset ac_cv_header_Python_h 63 | AC_CHECK_HEADER([Python.h], 64 | have_python_headers="yes", 65 | have_python_headers="no" ) 66 | 67 | dnl Test the libraries 68 | AC_MSG_CHECKING(for Python libraries) 69 | 70 | AC_TRY_LINK( , , have_python_libraries="yes", have_python_libraries="no") 71 | 72 | CPPFLAGS="$_CPPFLAGS" 73 | 74 | if test "$have_python_libraries" = "yes" 75 | then 76 | if test "$python_libraries" 77 | then 78 | AC_MSG_RESULT([$python_libraries]) 79 | else 80 | AC_MSG_RESULT(yes) 81 | fi 82 | else 83 | AC_MSG_RESULT(no) 84 | fi 85 | 86 | if test "$have_python_headers" = "yes" \ 87 | && test "$have_python_libraries" = "yes" 88 | then 89 | have_python="yes" 90 | else 91 | have_python="no" 92 | fi 93 | 94 | if test "$have_python" = "no" 95 | then 96 | AC_MSG_WARN([No python compilation environment for $1]) 97 | else 98 | [PYTHON]$2[_CFLAGS]="${PYTHON_CFLAGS}" 99 | AC_SUBST([PYTHON]$2[_CFLAGS]) 100 | AC_SUBST(PYTHON_CFLAGS) 101 | 102 | [PYTHON]$2[_LIBS]="${PYTHON_LIBS}" 103 | AC_SUBST([PYTHON]$2[_LIBS]) 104 | AC_SUBST(PYTHON_LIBS) 105 | AC_MSG_NOTICE([Found working python compilation environment for $1]) 106 | fi 107 | fi 108 | AM_CONDITIONAL([PYTHON_]$2, [test "$have_python" != "no"]) 109 | ]) 110 | 111 | AC_DEFUN([ALL_CC_PYTHON], 112 | [ 113 | m4_define([_AM_PYTHON_INTERPRETER_LIST], [python2.6 python2.5 python2.4 python2.3]) 114 | PYTHONS='' 115 | found_one='' 116 | _ONE_CC_PYTHON([=2.3], [2_3]) 117 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 118 | unset PYTHON 119 | _ONE_CC_PYTHON([=2.4], [2_4]) 120 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 121 | unset PYTHON 122 | _ONE_CC_PYTHON([=2.5], [2_5]) 123 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 124 | unset PYTHON 125 | _ONE_CC_PYTHON([=2.6], [2_6]) 126 | if test -f "$PYTHON" ; then found_one=$PYTHON ; PYTHONS="$PYTHON $PYTHONS" ; fi 127 | PYTHON=$found_one 128 | if ! test "$found_one" ; then 129 | AC_MSG_ERROR([No python development environments found]) 130 | fi 131 | ]) 132 | -------------------------------------------------------------------------------- /debian/.svn/entries: -------------------------------------------------------------------------------- 1 | 10 2 | 3 | dir 4 | 6581 5 | svn://svn.gna.org/svn/pokersource/trunk/pypoker-eval/debian 6 | svn://svn.gna.org/svn/pokersource 7 | 8 | 9 | 10 | 2010-09-04T08:03:42.358762Z 11 | 6508 12 | loic 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | c4f34931-41c7-4605-b615-9bb9f479c57e 28 | 29 | control.breezy 30 | file 31 | 32 | 33 | 34 | 35 | 2011-11-27T16:20:06.972122Z 36 | 0fcf02f05de6c92324897e2b2ca76c95 37 | 2006-11-15T11:04:02.000000Z 38 | 1834 39 | loic 40 | has-props 41 | 42 | 43 | 44 | 45 | 46 | 47 | 48 | 49 | 50 | 51 | 52 | 53 | 54 | 55 | 56 | 57 | 58 | 59 | 60 | 61 | 710 62 | 63 | control.sarge 64 | file 65 | 66 | 67 | 68 | 69 | 2011-11-27T16:20:06.976122Z 70 | 0fcf02f05de6c92324897e2b2ca76c95 71 | 2006-11-15T11:04:02.000000Z 72 | 1834 73 | loic 74 | has-props 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 710 96 | 97 | control 98 | file 99 | 100 | 101 | 102 | 103 | 2011-11-27T16:20:06.976122Z 104 | baeab517f066f0ce54a478d77da081e5 105 | 2010-09-04T06:07:08.460375Z 106 | 6506 107 | loic 108 | has-props 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 772 130 | 131 | control.feisty 132 | file 133 | 134 | 135 | 136 | 137 | 2011-11-27T16:20:06.976122Z 138 | a7902c785aaca9fe38ce53bbafb42d94 139 | 2008-12-26T11:50:41.665166Z 140 | 5351 141 | loic 142 | 143 | 144 | 145 | 146 | 147 | 148 | 149 | 150 | 151 | 152 | 153 | 154 | 155 | 156 | 157 | 158 | 159 | 160 | 161 | 162 | 163 | 749 164 | 165 | compat 166 | file 167 | 168 | 169 | 170 | 171 | 2011-11-27T16:20:06.976122Z 172 | 48a24b70a0b376535542b996af517398 173 | 2006-07-20T10:22:46.000000Z 174 | 1162 175 | loic 176 | has-props 177 | 178 | 179 | 180 | 181 | 182 | 183 | 184 | 185 | 186 | 187 | 188 | 189 | 190 | 191 | 192 | 193 | 194 | 195 | 196 | 197 | 2 198 | 199 | control.hardy 200 | file 201 | 202 | 203 | 204 | 205 | 2011-11-27T16:20:06.976122Z 206 | 109353f9188c77eb508ed8a382b46c1d 207 | 2008-11-04T07:12:28.712535Z 208 | 4818 209 | loic 210 | 211 | 212 | 213 | 214 | 215 | 216 | 217 | 218 | 219 | 220 | 221 | 222 | 223 | 224 | 225 | 226 | 227 | 228 | 229 | 230 | 231 | 744 232 | 233 | changelog 234 | file 235 | 236 | 237 | 238 | 239 | 2011-11-27T16:20:06.976122Z 240 | 3c0c00a6e0615fd2ae221b736cdf812b 241 | 2010-09-04T08:03:42.358762Z 242 | 6508 243 | loic 244 | has-props 245 | 246 | 247 | 248 | 249 | 250 | 251 | 252 | 253 | 254 | 255 | 256 | 257 | 258 | 259 | 260 | 261 | 262 | 263 | 264 | 265 | 6768 266 | 267 | control.jaunty 268 | file 269 | 270 | 271 | 272 | 273 | 2011-11-27T16:20:06.976122Z 274 | 109353f9188c77eb508ed8a382b46c1d 275 | 2008-11-04T18:09:14.096230Z 276 | 4829 277 | loic 278 | 279 | 280 | 281 | 282 | 283 | 284 | 285 | 286 | 287 | 288 | 289 | 290 | 291 | 292 | 293 | 294 | 295 | 296 | 297 | 298 | 299 | 744 300 | 301 | control.gutsy 302 | file 303 | 304 | 305 | 306 | 307 | 2011-11-27T16:20:06.976122Z 308 | a7902c785aaca9fe38ce53bbafb42d94 309 | 2008-12-26T11:50:41.665166Z 310 | 5351 311 | loic 312 | 313 | 314 | 315 | 316 | 317 | 318 | 319 | 320 | 321 | 322 | 323 | 324 | 325 | 326 | 327 | 328 | 329 | 330 | 331 | 332 | 333 | 749 334 | 335 | control.dapper 336 | file 337 | 338 | 339 | 340 | 341 | 2011-11-27T16:20:06.976122Z 342 | 0fcf02f05de6c92324897e2b2ca76c95 343 | 2006-11-15T11:04:02.000000Z 344 | 1834 345 | loic 346 | has-props 347 | 348 | 349 | 350 | 351 | 352 | 353 | 354 | 355 | 356 | 357 | 358 | 359 | 360 | 361 | 362 | 363 | 364 | 365 | 366 | 367 | 710 368 | 369 | rules 370 | file 371 | 372 | 373 | 374 | 375 | 2011-11-27T16:20:06.976122Z 376 | 3362bb8abec848454919650b0b2bb19a 377 | 2010-09-04T06:10:12.471422Z 378 | 6507 379 | loic 380 | has-props 381 | 382 | 383 | 384 | 385 | 386 | 387 | 388 | 389 | 390 | 391 | 392 | 393 | 394 | 395 | 396 | 397 | 398 | 399 | 400 | 401 | 1164 402 | 403 | control.unstable 404 | file 405 | 406 | 407 | 408 | 409 | 2011-11-27T16:20:06.980122Z 410 | baeab517f066f0ce54a478d77da081e5 411 | 2010-09-04T06:07:08.460375Z 412 | 6506 413 | loic 414 | has-props 415 | 416 | 417 | 418 | 419 | 420 | 421 | 422 | 423 | 424 | 425 | 426 | 427 | 428 | 429 | 430 | 431 | 432 | 433 | 434 | 435 | 772 436 | 437 | pycompat 438 | file 439 | 440 | 441 | 442 | 443 | 2011-11-27T16:20:06.980122Z 444 | 26ab0db90d72e28ad0ba1e22ee510510 445 | 2006-07-19T18:07:47.000000Z 446 | 1158 447 | loic 448 | has-props 449 | 450 | 451 | 452 | 453 | 454 | 455 | 456 | 457 | 458 | 459 | 460 | 461 | 462 | 463 | 464 | 465 | 466 | 467 | 468 | 469 | 2 470 | 471 | control.intrepid 472 | file 473 | 474 | 475 | 476 | 477 | 2011-11-27T16:20:06.980122Z 478 | 109353f9188c77eb508ed8a382b46c1d 479 | 2008-11-04T07:12:24.842917Z 480 | 4817 481 | loic 482 | 483 | 484 | 485 | 486 | 487 | 488 | 489 | 490 | 491 | 492 | 493 | 494 | 495 | 496 | 497 | 498 | 499 | 500 | 501 | 502 | 503 | 744 504 | 505 | control.squeeze 506 | file 507 | 508 | 509 | 510 | 511 | 2011-11-27T16:20:06.980122Z 512 | 1b97ae829b20e59dba1333dc51a4aa09 513 | 2010-04-06T11:39:53.349022Z 514 | 6479 515 | loic 516 | 517 | 518 | 519 | 520 | 521 | 522 | 523 | 524 | 525 | 526 | 527 | 528 | 529 | 530 | 531 | 532 | 533 | 534 | 535 | 536 | 537 | 775 538 | 539 | control.hoary 540 | file 541 | 542 | 543 | 544 | 545 | 2011-11-27T16:20:06.980122Z 546 | 0fcf02f05de6c92324897e2b2ca76c95 547 | 2006-11-15T11:04:02.000000Z 548 | 1834 549 | loic 550 | has-props 551 | 552 | 553 | 554 | 555 | 556 | 557 | 558 | 559 | 560 | 561 | 562 | 563 | 564 | 565 | 566 | 567 | 568 | 569 | 570 | 571 | 710 572 | 573 | control.etch 574 | file 575 | 576 | 577 | 578 | 579 | 2011-11-27T16:20:06.980122Z 580 | 2bf9051cbae2b01c8e384c41680c0f71 581 | 2008-12-26T11:50:41.665166Z 582 | 5351 583 | loic 584 | has-props 585 | 586 | 587 | 588 | 589 | 590 | 591 | 592 | 593 | 594 | 595 | 596 | 597 | 598 | 599 | 600 | 601 | 602 | 603 | 604 | 605 | 761 606 | 607 | control.lenny 608 | file 609 | 610 | 611 | 612 | 613 | 2011-11-27T16:20:06.980122Z 614 | 19aa581c633ee0481539e35fd5e6c641 615 | 2007-06-15T05:56:14.466882Z 616 | 3089 617 | loic 618 | 619 | 620 | 621 | 622 | 623 | 624 | 625 | 626 | 627 | 628 | 629 | 630 | 631 | 632 | 633 | 634 | 635 | 636 | 637 | 638 | 639 | 756 640 | 641 | control.edgy 642 | file 643 | 644 | 645 | 646 | 647 | 2011-11-27T16:20:06.980122Z 648 | a7902c785aaca9fe38ce53bbafb42d94 649 | 2008-12-26T11:50:41.665166Z 650 | 5351 651 | loic 652 | has-props 653 | 654 | 655 | 656 | 657 | 658 | 659 | 660 | 661 | 662 | 663 | 664 | 665 | 666 | 667 | 668 | 669 | 670 | 671 | 672 | 673 | 749 674 | 675 | copyright 676 | file 677 | 678 | 679 | 680 | 681 | 2011-11-27T16:20:06.980122Z 682 | e4edd703a08daf33a8e7248247380b32 683 | 2009-07-09T22:35:58.405756Z 684 | 6063 685 | loic 686 | has-props 687 | 688 | 689 | 690 | 691 | 692 | 693 | 694 | 695 | 696 | 697 | 698 | 699 | 700 | 701 | 702 | 703 | 704 | 705 | 706 | 707 | 1042 708 | 709 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | pypoker-eval (138.0-1) unstable; urgency=low 2 | 3 | * recompile to accomodate for the change of available python versions in sid (closes: #549979) 4 | * upstream sync 5 | 6 | -- Loic Dachary (OuoU) Sat, 04 Sep 2010 07:19:28 +0200 7 | 8 | pypoker-eval (137.0-1) unstable; urgency=low 9 | 10 | * upstream sync 11 | 12 | -- Loic Dachary (OuoU) Sat, 27 Dec 2008 11:56:14 +0100 13 | 14 | pypoker-eval (136.0-1) unstable; urgency=low 15 | 16 | * upstream sync 17 | 18 | -- Loic Dachary (OuoU) Fri, 26 Dec 2008 12:00:54 +0100 19 | 20 | pypoker-eval (135.0-1) unstable; urgency=low 21 | 22 | * upstream sync 23 | 24 | -- Loic Dachary (OuoU) Wed, 16 May 2007 14:03:33 +0200 25 | 26 | pypoker-eval (134.0-1) unstable; urgency=low 27 | 28 | * upstream sync 29 | 30 | * edgy fix 31 | 32 | -- Loic Dachary (OuoU) Mon, 12 Feb 2007 23:41:43 +0100 33 | 34 | pypoker-eval (133.0-2) unstable; urgency=low 35 | 36 | * recompile against poker-eval 37 | 38 | * do not link against python lib (closes: #395866) 39 | 40 | -- Loic Dachary (OuoU) Sat, 28 Oct 2006 16:42:56 +0200 41 | 42 | pypoker-eval (133.0-1) unstable; urgency=low 43 | 44 | * edgy & etch control files 45 | 46 | * upstream sync 47 | 48 | -- Loic Dachary (OuoU) Tue, 12 Sep 2006 15:18:07 +0200 49 | 50 | pypoker-eval (132.0-1) unstable; urgency=low 51 | 52 | * upstream sync 53 | 54 | -- Loic Dachary (OuoU) Sun, 16 Apr 2006 03:24:15 +0200 55 | 56 | pypoker-eval (131.0-1) unstable; urgency=low 57 | 58 | * upstream sync 59 | 60 | -- Loic Dachary (OuoU) Mon, 13 Mar 2006 10:36:44 +0100 61 | 62 | pypoker-eval (130.0-1) unstable; urgency=low 63 | 64 | * upstream sync 65 | 66 | -- Loic Dachary (OuoU) Fri, 10 Mar 2006 21:04:00 +0100 67 | 68 | pypoker-eval (129.0-1) unstable; urgency=low 69 | 70 | * upstream sync 71 | 72 | -- Loic Dachary (OuoU) Mon, 16 Jan 2006 17:13:24 +0100 73 | 74 | pypoker-eval (128.0-1) unstable; urgency=low 75 | 76 | * switch to cdbs 77 | 78 | * upstream sync 79 | 80 | -- Loic Dachary (OuoU) Tue, 20 Sep 2005 15:27:54 +0200 81 | 82 | pypoker-eval (127.0-2) unstable; urgency=low 83 | 84 | * force python 2.3 85 | * update copyright url 86 | 87 | -- Ludovic Heyberber (gorila) Thu, 8 Sep 2005 13:45:53 +0200 88 | 89 | pypoker-eval (127.0-1) unstable; urgency=low 90 | 91 | * upstream sync 92 | 93 | -- Loic Dachary (OuoU) Wed, 27 Apr 2005 14:46:50 +0200 94 | 95 | pypoker-eval (126.0-1) unstable; urgency=low 96 | 97 | * upstream sync 98 | 99 | -- Loic Dachary (OuoU) Thu, 9 Dec 2004 18:22:08 +0100 100 | 101 | pypoker-eval (125.0-1) unstable; urgency=low 102 | 103 | * upstream sync 104 | 105 | -- Loic Dachary (OuoU) Mon, 6 Dec 2004 18:41:24 +0100 106 | 107 | pypoker-eval (124.0-2) unstable; urgency=low 108 | 109 | * relaunch buildd 110 | 111 | -- Loic Dachary (OuoU) Sun, 7 Nov 2004 20:52:35 +0100 112 | 113 | pypoker-eval (124.0-1) unstable; urgency=low 114 | 115 | * poker-eval upstream API change 116 | 117 | -- Loic Dachary (OuoU) Sun, 7 Nov 2004 16:30:26 +0100 118 | 119 | pypoker-eval (122.0-5) unstable; urgency=low 120 | 121 | * Re-launch buildd. 122 | 123 | -- Loic Dachary (OuoU) Mon, 25 Oct 2004 13:11:40 +0200 124 | 125 | pypoker-eval (122.0-4) unstable; urgency=low 126 | 127 | * Fullfill ITP (Closes: #277330) 128 | 129 | -- Loic Dachary (OuoU) Wed, 20 Oct 2004 00:04:59 +0200 130 | 131 | pypoker-eval (122.0-3) unstable; urgency=low 132 | 133 | * missing documentation 134 | 135 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 23:53:26 +0200 136 | 137 | pypoker-eval (122.0-2) unstable; urgency=low 138 | 139 | * missing dependency on python in addition to python2.3 140 | 141 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 16:34:38 +0200 142 | 143 | pypoker-eval (122.0-1) unstable; urgency=low 144 | 145 | * Sync with poker-eval distribution 146 | 147 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 12:42:43 +0200 148 | 149 | pypoker-eval (121.0-21) unstable; urgency=low 150 | 151 | * lowbal eval conflict with omaha8 152 | 153 | -- Loic Dachary (OuoU) Tue, 22 Sept 2004 17:09:32 +0200 154 | 155 | pypoker-eval (121.0-20) unstable; urgency=low 156 | 157 | * missing hand initialization 158 | 159 | -- Loic Dachary (OuoU) Sun, 21 Sept 2004 17:09:32 +0200 160 | 161 | pypoker-eval (121.0-19) unstable; urgency=low 162 | 163 | * missing STFLUSH in best hand build 164 | 165 | -- Loic Dachary (OuoU) Sun, 19 Sept 2004 17:09:32 +0200 166 | 167 | pypoker-eval (121.0-18) unstable; urgency=low 168 | 169 | * leak reduction 170 | 171 | -- Loic Dachary (OuoU) Fri, 23 Jul 2004 17:09:32 +0200 172 | 173 | pypoker-eval (121.0-17) unstable; urgency=low 174 | 175 | * strong dependencies 176 | 177 | -- Loic Dachary (OuoU) Sun, 4 Jul 2004 17:35:21 +0200 178 | 179 | pypoker-eval (121.0-16) unstable; urgency=low 180 | 181 | * stud 7 eval 182 | 183 | -- Loic Dachary (OuoU) Thu, 29 Apr 2004 14:26:02 +0200 184 | 185 | pypoker-eval (121.0-15) unstable; urgency=low 186 | 187 | * fill pockets if at least one placeholder 188 | 189 | -- Loic Dachary (OuoU) Wed, 28 Apr 2004 18:46:43 +0200 190 | 191 | pypoker-eval (121.0-14) unstable; urgency=low 192 | 193 | * evaln interface 194 | 195 | -- Loic Dachary (OuoU) Wed, 28 Apr 2004 14:57:20 +0200 196 | 197 | pypoker-eval (121.0-13) unstable; urgency=low 198 | 199 | * card count bug 200 | 201 | -- Loic Dachary (OuoU) Mon, 19 Apr 2004 21:08:44 +0200 202 | 203 | pypoker-eval (121.0-12) unstable; urgency=low 204 | 205 | * workaround portability hack 206 | 207 | -- Loic Dachary (OuoU) Fri, 16 Apr 2004 15:15:12 +0200 208 | 209 | pypoker-eval (121.0-11) unstable; urgency=low 210 | 211 | * fill pockets 212 | 213 | -- Loic Dachary (OuoU) Wed, 14 Apr 2004 14:30:33 +0200 214 | 215 | pypoker-eval (121.0-10) unstable; urgency=low 216 | 217 | * tuples accepted 218 | 219 | -- Loic Dachary (OuoU) Fri, 2 Apr 2004 23:39:34 +0200 220 | 221 | pypoker-eval (121.0-9) unstable; urgency=low 222 | 223 | * enumerate for all games 224 | 225 | -- Loic Dachary (OuoU) Mon, 29 Mar 2004 20:15:36 +0200 226 | 227 | pypoker-eval (121.0-8) unstable; urgency=low 228 | 229 | * added autoconf and automake to dep's list 230 | 231 | -- Henry Precheur Tue, 23 Mar 2004 17:42:48 +0100 232 | 233 | pypoker-eval (121.0-7) unstable; urgency=low 234 | 235 | * variable length hand fix 236 | 237 | -- Loic Dachary (OuoU) Tue, 23 Mar 2004 11:41:09 +0100 238 | 239 | pypoker-eval (121.0-6) unstable; urgency=low 240 | 241 | * portability 242 | 243 | -- Loic Dachary (OuoU) Mon, 22 Mar 2004 11:17:32 +0100 244 | 245 | pypoker-eval (121.0-5) unstable; urgency=low 246 | 247 | * check numerical card range 248 | 249 | -- Loic Dachary (OuoU) Thu, 18 Mar 2004 12:47:00 +0100 250 | 251 | pypoker-eval (121.0-4) unstable; urgency=low 252 | 253 | * sorted straights 254 | 255 | -- Loic Dachary (OuoU) Thu, 11 Mar 2004 22:23:53 +0100 256 | 257 | pypoker-eval (121.0-3) unstable; urgency=low 258 | 259 | * sorted hands 260 | 261 | -- Loic Dachary (OuoU) Thu, 11 Mar 2004 16:56:12 +0100 262 | 263 | pypoker-eval (121.0-2) unstable; urgency=low 264 | 265 | * config.h update 266 | 267 | -- Loic Dachary (OuoU) Wed, 25 Feb 2004 23:10:13 +0100 268 | 269 | pypoker-eval (121.0-1) unstable; urgency=low 270 | 271 | * Initial Release. 272 | 273 | -- Loic Dachary (OuoU) Sat, 21 Feb 2004 13:35:33 +0100 274 | 275 | -------------------------------------------------------------------------------- /debian/.svn/text-base/changelog.svn-base: -------------------------------------------------------------------------------- 1 | pypoker-eval (138.0-1) unstable; urgency=low 2 | 3 | * recompile to accomodate for the change of available python versions in sid (closes: #549979) 4 | * upstream sync 5 | 6 | -- Loic Dachary (OuoU) Sat, 04 Sep 2010 07:19:28 +0200 7 | 8 | pypoker-eval (137.0-1) unstable; urgency=low 9 | 10 | * upstream sync 11 | 12 | -- Loic Dachary (OuoU) Sat, 27 Dec 2008 11:56:14 +0100 13 | 14 | pypoker-eval (136.0-1) unstable; urgency=low 15 | 16 | * upstream sync 17 | 18 | -- Loic Dachary (OuoU) Fri, 26 Dec 2008 12:00:54 +0100 19 | 20 | pypoker-eval (135.0-1) unstable; urgency=low 21 | 22 | * upstream sync 23 | 24 | -- Loic Dachary (OuoU) Wed, 16 May 2007 14:03:33 +0200 25 | 26 | pypoker-eval (134.0-1) unstable; urgency=low 27 | 28 | * upstream sync 29 | 30 | * edgy fix 31 | 32 | -- Loic Dachary (OuoU) Mon, 12 Feb 2007 23:41:43 +0100 33 | 34 | pypoker-eval (133.0-2) unstable; urgency=low 35 | 36 | * recompile against poker-eval 37 | 38 | * do not link against python lib (closes: #395866) 39 | 40 | -- Loic Dachary (OuoU) Sat, 28 Oct 2006 16:42:56 +0200 41 | 42 | pypoker-eval (133.0-1) unstable; urgency=low 43 | 44 | * edgy & etch control files 45 | 46 | * upstream sync 47 | 48 | -- Loic Dachary (OuoU) Tue, 12 Sep 2006 15:18:07 +0200 49 | 50 | pypoker-eval (132.0-1) unstable; urgency=low 51 | 52 | * upstream sync 53 | 54 | -- Loic Dachary (OuoU) Sun, 16 Apr 2006 03:24:15 +0200 55 | 56 | pypoker-eval (131.0-1) unstable; urgency=low 57 | 58 | * upstream sync 59 | 60 | -- Loic Dachary (OuoU) Mon, 13 Mar 2006 10:36:44 +0100 61 | 62 | pypoker-eval (130.0-1) unstable; urgency=low 63 | 64 | * upstream sync 65 | 66 | -- Loic Dachary (OuoU) Fri, 10 Mar 2006 21:04:00 +0100 67 | 68 | pypoker-eval (129.0-1) unstable; urgency=low 69 | 70 | * upstream sync 71 | 72 | -- Loic Dachary (OuoU) Mon, 16 Jan 2006 17:13:24 +0100 73 | 74 | pypoker-eval (128.0-1) unstable; urgency=low 75 | 76 | * switch to cdbs 77 | 78 | * upstream sync 79 | 80 | -- Loic Dachary (OuoU) Tue, 20 Sep 2005 15:27:54 +0200 81 | 82 | pypoker-eval (127.0-2) unstable; urgency=low 83 | 84 | * force python 2.3 85 | * update copyright url 86 | 87 | -- Ludovic Heyberber (gorila) Thu, 8 Sep 2005 13:45:53 +0200 88 | 89 | pypoker-eval (127.0-1) unstable; urgency=low 90 | 91 | * upstream sync 92 | 93 | -- Loic Dachary (OuoU) Wed, 27 Apr 2005 14:46:50 +0200 94 | 95 | pypoker-eval (126.0-1) unstable; urgency=low 96 | 97 | * upstream sync 98 | 99 | -- Loic Dachary (OuoU) Thu, 9 Dec 2004 18:22:08 +0100 100 | 101 | pypoker-eval (125.0-1) unstable; urgency=low 102 | 103 | * upstream sync 104 | 105 | -- Loic Dachary (OuoU) Mon, 6 Dec 2004 18:41:24 +0100 106 | 107 | pypoker-eval (124.0-2) unstable; urgency=low 108 | 109 | * relaunch buildd 110 | 111 | -- Loic Dachary (OuoU) Sun, 7 Nov 2004 20:52:35 +0100 112 | 113 | pypoker-eval (124.0-1) unstable; urgency=low 114 | 115 | * poker-eval upstream API change 116 | 117 | -- Loic Dachary (OuoU) Sun, 7 Nov 2004 16:30:26 +0100 118 | 119 | pypoker-eval (122.0-5) unstable; urgency=low 120 | 121 | * Re-launch buildd. 122 | 123 | -- Loic Dachary (OuoU) Mon, 25 Oct 2004 13:11:40 +0200 124 | 125 | pypoker-eval (122.0-4) unstable; urgency=low 126 | 127 | * Fullfill ITP (Closes: #277330) 128 | 129 | -- Loic Dachary (OuoU) Wed, 20 Oct 2004 00:04:59 +0200 130 | 131 | pypoker-eval (122.0-3) unstable; urgency=low 132 | 133 | * missing documentation 134 | 135 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 23:53:26 +0200 136 | 137 | pypoker-eval (122.0-2) unstable; urgency=low 138 | 139 | * missing dependency on python in addition to python2.3 140 | 141 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 16:34:38 +0200 142 | 143 | pypoker-eval (122.0-1) unstable; urgency=low 144 | 145 | * Sync with poker-eval distribution 146 | 147 | -- Loic Dachary (OuoU) Tue, 19 Oct 2004 12:42:43 +0200 148 | 149 | pypoker-eval (121.0-21) unstable; urgency=low 150 | 151 | * lowbal eval conflict with omaha8 152 | 153 | -- Loic Dachary (OuoU) Tue, 22 Sept 2004 17:09:32 +0200 154 | 155 | pypoker-eval (121.0-20) unstable; urgency=low 156 | 157 | * missing hand initialization 158 | 159 | -- Loic Dachary (OuoU) Sun, 21 Sept 2004 17:09:32 +0200 160 | 161 | pypoker-eval (121.0-19) unstable; urgency=low 162 | 163 | * missing STFLUSH in best hand build 164 | 165 | -- Loic Dachary (OuoU) Sun, 19 Sept 2004 17:09:32 +0200 166 | 167 | pypoker-eval (121.0-18) unstable; urgency=low 168 | 169 | * leak reduction 170 | 171 | -- Loic Dachary (OuoU) Fri, 23 Jul 2004 17:09:32 +0200 172 | 173 | pypoker-eval (121.0-17) unstable; urgency=low 174 | 175 | * strong dependencies 176 | 177 | -- Loic Dachary (OuoU) Sun, 4 Jul 2004 17:35:21 +0200 178 | 179 | pypoker-eval (121.0-16) unstable; urgency=low 180 | 181 | * stud 7 eval 182 | 183 | -- Loic Dachary (OuoU) Thu, 29 Apr 2004 14:26:02 +0200 184 | 185 | pypoker-eval (121.0-15) unstable; urgency=low 186 | 187 | * fill pockets if at least one placeholder 188 | 189 | -- Loic Dachary (OuoU) Wed, 28 Apr 2004 18:46:43 +0200 190 | 191 | pypoker-eval (121.0-14) unstable; urgency=low 192 | 193 | * evaln interface 194 | 195 | -- Loic Dachary (OuoU) Wed, 28 Apr 2004 14:57:20 +0200 196 | 197 | pypoker-eval (121.0-13) unstable; urgency=low 198 | 199 | * card count bug 200 | 201 | -- Loic Dachary (OuoU) Mon, 19 Apr 2004 21:08:44 +0200 202 | 203 | pypoker-eval (121.0-12) unstable; urgency=low 204 | 205 | * workaround portability hack 206 | 207 | -- Loic Dachary (OuoU) Fri, 16 Apr 2004 15:15:12 +0200 208 | 209 | pypoker-eval (121.0-11) unstable; urgency=low 210 | 211 | * fill pockets 212 | 213 | -- Loic Dachary (OuoU) Wed, 14 Apr 2004 14:30:33 +0200 214 | 215 | pypoker-eval (121.0-10) unstable; urgency=low 216 | 217 | * tuples accepted 218 | 219 | -- Loic Dachary (OuoU) Fri, 2 Apr 2004 23:39:34 +0200 220 | 221 | pypoker-eval (121.0-9) unstable; urgency=low 222 | 223 | * enumerate for all games 224 | 225 | -- Loic Dachary (OuoU) Mon, 29 Mar 2004 20:15:36 +0200 226 | 227 | pypoker-eval (121.0-8) unstable; urgency=low 228 | 229 | * added autoconf and automake to dep's list 230 | 231 | -- Henry Precheur Tue, 23 Mar 2004 17:42:48 +0100 232 | 233 | pypoker-eval (121.0-7) unstable; urgency=low 234 | 235 | * variable length hand fix 236 | 237 | -- Loic Dachary (OuoU) Tue, 23 Mar 2004 11:41:09 +0100 238 | 239 | pypoker-eval (121.0-6) unstable; urgency=low 240 | 241 | * portability 242 | 243 | -- Loic Dachary (OuoU) Mon, 22 Mar 2004 11:17:32 +0100 244 | 245 | pypoker-eval (121.0-5) unstable; urgency=low 246 | 247 | * check numerical card range 248 | 249 | -- Loic Dachary (OuoU) Thu, 18 Mar 2004 12:47:00 +0100 250 | 251 | pypoker-eval (121.0-4) unstable; urgency=low 252 | 253 | * sorted straights 254 | 255 | -- Loic Dachary (OuoU) Thu, 11 Mar 2004 22:23:53 +0100 256 | 257 | pypoker-eval (121.0-3) unstable; urgency=low 258 | 259 | * sorted hands 260 | 261 | -- Loic Dachary (OuoU) Thu, 11 Mar 2004 16:56:12 +0100 262 | 263 | pypoker-eval (121.0-2) unstable; urgency=low 264 | 265 | * config.h update 266 | 267 | -- Loic Dachary (OuoU) Wed, 25 Feb 2004 23:10:13 +0100 268 | 269 | pypoker-eval (121.0-1) unstable; urgency=low 270 | 271 | * Initial Release. 272 | 273 | -- Loic Dachary (OuoU) Sat, 21 Feb 2004 13:35:33 +0100 274 | 275 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | 2009-08-12 Loic Dachary 2 | 3 | * Release 138.0 4 | 5 | 2009-07-09 Loic Dachary 6 | 7 | * Release 137.0 8 | 9 | * debian/rules: remove .la from distribution because it's not 10 | needed for python plugins 11 | * debian/copyright: upgrade copyright notice to GPLv3 12 | * debian/control: upgrade section to python, upgrade policy, add 13 | misc:Depends 14 | 15 | 2009-06-09 Loic Dachary 16 | 17 | * pokereval.py: improved documentation for the "best" method 18 | (courtesy tsr_) 19 | 20 | 2008-12-27 Loic Dachary 21 | 22 | * ChangeLog, NEWS, configure.ac, debian/changelog: bump to version 23 | 137 24 | 25 | 2008-12-26 Loic Dachary 26 | 27 | * Release 136.0 28 | 29 | * debian/control.edgy, debian/control.etch, debian/control.feisty, 30 | debian/control.gutsy: add g++ dependency for backport to obey the 31 | r5119 bkuhn AC_PROG_CXX addition 32 | * ChangeLog, NEWS, debian/changelog: version bump to 136 33 | 34 | 2008-12-25 Loic Dachary 35 | 36 | * debian/copyright: license upgrade to GPLv3+ 37 | * COPYING, bug-1823.py, config/ccpython.m4, configure.ac, 38 | pokereval.py, pypokereval.c, test.py: license upgrade to GPLv3+ 39 | 40 | 2008-12-02 Bradley M. Kuhn 41 | 42 | * configure.ac (AC_PROG_CPP): AC_PROG_CPP appears to be 43 | deprecated; switched to AC_PROG_CXX 44 | 45 | 2008-11-30 Bradley M. Kuhn 46 | 47 | * config/python.m4 (AM_PATH_PYTHON): Added python2.6 support. 48 | 49 | * config/ccpython.m4 (ALL_CC_PYTHON): Added python2.6 support. 50 | 51 | 2008-03-01 Loic Dachary 52 | 53 | * Release 135.0 54 | 55 | * Makefile.am, configure.ac: osx compilation fixes 56 | 57 | 2007-12-02 Loic Dachary 58 | 59 | * AUTHORS, Makefile.am, README, config/ccpython.m4, configure.ac, 60 | debian/copyright, pokereval.py, pypokereval.c, test.py: update 61 | copyrights 62 | * Makefile.am: https://gna.org/support/index.php?1823 test case 63 | * bug-1823.py: test that the comparison operator change of 64 | INNER_LOOP macro did not introduce an obvious problem 65 | * pypokereval.c: compare double with > instead of == 66 | 67 | 2007-07-24 Loic Dachary 68 | 69 | * config/ccpython.m4: cygwin hack is no longer necessary: it does 70 | not work anyways 71 | 72 | 2007-06-15 Loic Dachary 73 | 74 | * debian/control.gutsy, debian/control.lenny: lenny and gutsy 75 | support 76 | 77 | 2007-05-16 Loic Dachary 78 | 79 | * ChangeLog, NEWS, debian/changelog: Version bump. 80 | 81 | 2007-02-14 Loic Dachary 82 | 83 | * debian/control.feisty: feisty support 84 | 85 | 2007-02-13 Loic Dachary 86 | 87 | * config/ccpython.m4: detect 25 & unset cache 88 | 89 | 2007-02-12 Loic Dachary 90 | 91 | * debian/changelog: upstream sync 92 | * debian/changelog: edgy fix 93 | * debian/control.edgy: edgy needs pycentral for python2.5 94 | 95 | 2006-11-20 cpinson 96 | 97 | * gentoo/dev-games/pypoker-eval/pypoker-eval-132.0-r1.ebuild: down 98 | * trunk/poker-eval/gentoo/dev-games/poker-eval/poker-eval-133.0-r1.ebuild, 99 | gentoo/dev-games/pypoker-eval/pypoker-eval-133.0-r1.ebuild: up 100 | 101 | 2006-11-15 Loic Dachary 102 | 103 | * debian/control, debian/control.breezy, debian/control.dapper, 104 | debian/control.edgy, debian/control.etch, debian/control.hoary, 105 | debian/control.sarge, debian/control.unstable: poker2.4 conflicts 106 | 107 | 2006-10-29 Loic Dachary 108 | 109 | * Release 134.0 110 | 111 | 2006-10-01 Cedric Pinson 112 | 113 | * Release 133.0 114 | 115 | * Update gentoo package 116 | 117 | 2006-09-12 Loic Dachary 118 | 119 | * debian/changelog: edgy & etch control files 120 | 121 | * debian/control.edgy, debian/control.etch: edgy & etch 122 | 123 | 2006-07-19 Loic Dachary 124 | 125 | * Release 132.0 126 | 127 | * test.py: Look for modules in .libs. 128 | 129 | * pypokereval.c: Module name compilation depend. 130 | 131 | * pypoker-eval.pc.in: 132 | Path have to be retrieved from python directly instead of from the .pc 133 | 134 | * pokereval.py: Binary module import depends on python version. 135 | 136 | * debian/control: Obsolete versioned packages 137 | 138 | * debian/compat: *** empty log message *** 139 | 140 | * debian/changelog: 132 141 | 142 | * debian/rules: Depend on pycentral instead of custom made rules 143 | 144 | * configure.ac: Look for all installed python versions. 145 | 146 | * config/python.m4, config/ccpython.m4: 147 | Generate versioned variables for every python development environment available. 148 | 149 | * README: more explicit title 150 | 151 | * NEWS: 132 152 | 153 | * Makefile.am: 154 | The module is compiled for every available python development environment. No need for post install tweaks. 155 | 156 | 2006-07-19 Loic Dachary 157 | 158 | * configure.ac: compile for 2.5, 2.4 and 2.3 python versions, rename all 159 | shared libs. 160 | 161 | Fri Jun 09 2006 Cedric Pinson 162 | 163 | * Release 131.0 164 | 165 | * gentoo/dev-games/pypoker-eval/pypoker-eval-131.0-r1.ebuild: 166 | Update gentoo package 167 | 168 | Sat Apr 15 2006 Loic Dachary 169 | 170 | * configure.ac: get rid of bootstrap + autotools tweaks 171 | 172 | Wed Mar 29 2006 Loic Dachary 173 | 174 | * Makefile.am (EXTRA_DIST): gentoo files 175 | 176 | Mon Mar 13 2006 Loic Dachary 177 | 178 | * pypokereval.c: kill compilation warnings 179 | 180 | Fri Mar 10 2006 Loic Dachary 181 | 182 | * Release 130.0 183 | 184 | * python2.2 support for redhat9 (https://sourceforge.net/tracker/index.php?func=detail&aid=1428078&group_id=13546&atid=213546) 185 | 186 | Mon Jan 16 2006 Loic Dachary 187 | 188 | * Release 129.0 189 | 190 | * cygwin portability fixes 191 | 192 | Thu Sep 22 2005 Loic Dachary 193 | 194 | * Release 128.0 195 | 196 | * Makefile.am (pkgconfig_DATA): pypoker-eval.pc 197 | 198 | Wed Sep 21 2005 Loic Dachary 199 | 200 | * bootstrap: upgrade 201 | 202 | * configure.ac: strict selection of python interpreter is allowed 203 | 204 | * config/ccpython.m4: rebuild from scratch 205 | 206 | * config/python.m4: fix bugous header detection 207 | 208 | Wed Apr 27 17:47:45 2005 Loic Dachary 209 | 210 | * Release 127.0 211 | 212 | * pypokereval.c: use COMBINATIONS instead of PERMUTATIONS when 213 | enumerating unknown cards. 214 | 215 | Fri Dec 10 11:49:26 2004 Loic Dachary 216 | 217 | * Release 126.0 218 | 219 | * pokereval.py (winners): fill_pockets is set => fill_pockets is not set. iteration 220 | is infinite by default, not 1. 221 | 222 | Thu Dec 09 18:20:59 2004 Loic Dachary 223 | 224 | * pypokereval.c (CardMask2PyList): must not use implicit StdDeck_maskToCard. Use CurDeck instead. 225 | 226 | * configure.ac: add warnings 227 | 228 | Mon Dec 06 18:40:29 2004 Loic Dachary 229 | 230 | * Release 125.0 231 | 232 | * RPM packages from Jean-Christophe Duberga 233 | 234 | Tue Oct 19 16:35:49 2004 Loic Dachary 235 | 236 | * Release 122.0 237 | 238 | * Documentation 239 | 240 | Sun Sep 19 13:14:34 2004 Loic Dachary 241 | 242 | * pypokereval.c (eval_hand): wrongly picked 3 cards from hole 243 | cards in omaha8. Reworked the function. 244 | 245 | https://gna.org/bugs/index.php?func=detailitem&item_id=735 246 | 247 | * pypokereval.c (CardMask2SortedPyList): add missing STFLUSH case. 248 | https://gna.org/bugs/index.php?func=detailitem&item_id=735 249 | 250 | Fri Jul 23 17:18:16 2004 Loic Dachary 251 | 252 | * pypokereval.c: Py_DECREF where appropriate 253 | 254 | Sat Feb 21 12:56:11 2004 Loic Dachary 255 | 256 | * Initial revision 257 | 258 | Local Variables: 259 | compile-command: "svn update ; svn2cl --group-by-day --authors=$(echo $HOME)/.svn2cl --stdout | head -2000 | sed -n '0,/^2008-11-01/p'" 260 | End: 261 | -------------------------------------------------------------------------------- /config/python.m4: -------------------------------------------------------------------------------- 1 | ## ------------------------ -*- Autoconf -*- 2 | ## Python file handling 3 | ## From Andrew Dalke 4 | ## Updated by James Henstridge 5 | ## Updated by Ludovic Heyberger (2005), Loic Dachary (2006) 6 | ## ------------------------ 7 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 8 | # Free Software Foundation, Inc. 9 | # 10 | # This file is free software; the Free Software Foundation 11 | # gives unlimited permission to copy and/or distribute it, 12 | # with or without modifications, as long as this notice is preserved. 13 | 14 | # AM_PATH_PYTHON([VERSION-CONSTRAINT], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 15 | # --------------------------------------------------------------------------- 16 | # Adds support for distributing Python modules and packages. To 17 | # install modules, copy them to $(pythondir), using the python_PYTHON 18 | # automake variable. To install a package with the same name as the 19 | # automake package, install to $(pkgpythondir), or use the 20 | # pkgpython_PYTHON automake variable. 21 | # 22 | # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as 23 | # locations to install python extension modules (shared libraries). 24 | # Another macro is required to find the appropriate flags to compile 25 | # extension modules. 26 | # 27 | # If your package is configured with a different prefix to python, 28 | # users will have to add the install directory to the PYTHONPATH 29 | # environment variable, or create a .pth file (see the python 30 | # documentation for details). 31 | # 32 | # If the VERSION-CONSTRAINT argument is passed, AM_PATH_PYTHON will 33 | # cause an error if the version of python installed on the system 34 | # doesn't meet the requirement. VERSION-CONSTRAINT should consist of 35 | # an operator (>=, <=, =, >, <) followed by a version (1, 2, 2.3, 2.4, 1.5.2 etc.) 36 | # Examples: >2.3, =2.2, >=1.5.1 ... If the operator is omited, it defaults 37 | # to >= (i.e. 2.3 is equivalent to >=2.3) 38 | AC_DEFUN([AM_PATH_PYTHON], 39 | [ 40 | dnl Find a Python interpreter. Python versions prior to 1.5 are not 41 | dnl supported because the default installation locations changed from 42 | dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages 43 | dnl in 1.5. 44 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST], 45 | [python python2 python2.5 python2.6 python2.4 python2.3 python2.2 dnl 46 | python2.1 python2.0 python1.6 python1.5]) 47 | 48 | m4_if([$1],[],[ 49 | dnl No version check is needed. 50 | # Find any Python interpreter. 51 | if test -z "$PYTHON"; then 52 | AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) 53 | fi 54 | am_display_PYTHON=python 55 | ], [ 56 | if expr "$1" : "[[<>=]]" > /dev/null ; then 57 | required_version="$1" 58 | elif test -z "$1" || expr "$1" : '[ ]*$' > /dev/null ; then 59 | required_version="" 60 | else 61 | required_version=">=$1" 62 | fi 63 | dnl A version check is needed. 64 | if test -n "$PYTHON"; then 65 | # If the user set $PYTHON, use it and don't search something else. 66 | AC_MSG_CHECKING([whether $PYTHON version $required_version]) 67 | AM_PYTHON_CHECK_VERSION([$PYTHON], [$required_version], 68 | [AC_MSG_RESULT(yes)], 69 | [AC_MSG_ERROR(too old)]) 70 | am_display_PYTHON=$PYTHON 71 | else 72 | # Otherwise, try each interpreter until we find one that satisfies 73 | # VERSION. 74 | AC_MSG_CHECKING([for a Python interpreter with version $required_version]) 75 | for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do 76 | test "$am_cv_pathless_PYTHON" = none && break 77 | AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$required_version], [break]) 78 | done 79 | AC_MSG_RESULT([done]) 80 | # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. 81 | if test "$am_cv_pathless_PYTHON" = none; then 82 | PYTHON=: 83 | else 84 | unset ac_cv_path_PYTHON 85 | AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) 86 | fi 87 | am_display_PYTHON=$am_cv_pathless_PYTHON 88 | fi 89 | ]) 90 | 91 | if test "$PYTHON" = :; then 92 | dnl Run any user-specified action, or abort. 93 | m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found for $1])]) 94 | else 95 | 96 | dnl Query Python for its version number. Getting [:3] seems to be 97 | dnl the best way to do this; it's what "site.py" does in the standard 98 | dnl library. 99 | 100 | AC_MSG_CHECKING([for $am_display_PYTHON version]) 101 | am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"` 102 | AC_MSG_RESULT([done]) 103 | AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) 104 | 105 | dnl Use the values of $prefix and $exec_prefix for the corresponding 106 | dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made 107 | dnl distinct variables so they can be overridden if need be. However, 108 | dnl general consensus is that you shouldn't need this ability. 109 | 110 | AC_SUBST([PYTHON_PREFIX], ['${prefix}']) 111 | AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) 112 | 113 | dnl At times (like when building shared libraries) you may want 114 | dnl to know which OS platform Python thinks this is. 115 | 116 | AC_MSG_CHECKING([for $am_display_PYTHON platform]) 117 | am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` 118 | AC_MSG_RESULT([done]) 119 | AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) 120 | 121 | 122 | dnl Set up 4 directories: 123 | 124 | dnl pythondir -- where to install python scripts. This is the 125 | dnl site-packages directory, not the python standard library 126 | dnl directory like in previous automake betas. This behavior 127 | dnl is more consistent with lispdir.m4 for example. 128 | dnl Query distutils for this directory. distutils does not exist in 129 | dnl Python 1.5, so we fall back to the hardcoded directory if it 130 | dnl doesn't work. 131 | AC_MSG_CHECKING([for $am_display_PYTHON script directory]) 132 | am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || 133 | echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` 134 | AC_MSG_RESULT([done]) 135 | AC_SUBST([pythondir], [$am_cv_python_pythondir]) 136 | 137 | dnl pkgpythondir -- $PACKAGE directory under pythondir. Was 138 | dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is 139 | dnl more consistent with the rest of automake. 140 | 141 | AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) 142 | 143 | dnl pyexecdir -- directory for installing python extension modules 144 | dnl (shared libraries) 145 | dnl Query distutils for this directory. distutils does not exist in 146 | dnl Python 1.5, so we fall back to the hardcoded directory if it 147 | dnl doesn't work. 148 | AC_MSG_CHECKING([for $am_display_PYTHON extension module directory]) 149 | am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || 150 | echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` 151 | AC_MSG_RESULT([done]) 152 | AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) 153 | 154 | dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) 155 | 156 | AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) 157 | 158 | dnl Run any user-specified action. 159 | $2 160 | fi 161 | unset am_cv_pathless_PYTHON 162 | unset am_cv_python_version 163 | unset am_cv_python_platform 164 | unset am_cv_python_pythondir 165 | unset am_cv_python_pyexecdir 166 | ]) 167 | 168 | 169 | # AM_PYTHON_CHECK_VERSION(PROG, VERSION-CONSTRAINT, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 170 | # --------------------------------------------------------------------------- 171 | # Run ACTION-IF-TRUE if the Python interpreter PROG has version that 172 | # satifies VERSION-CONSTRAINT. 173 | # Run ACTION-IF-FALSE otherwise. 174 | # This test uses sys.hexversion instead of the string equivalent (first 175 | # word of sys.version), in order to cope with versions such as 2.2c1. 176 | # hexversion has been introduced in Python 1.5.2; it's probably not 177 | # worth to support older versions (1.5.1 was released on October 31, 1998). 178 | # Do *not* use the operator as it is not available in every supported 179 | # python versions 180 | AC_DEFUN([AM_PYTHON_CHECK_VERSION], 181 | [prog="import sys, string 182 | if '$2' == '': sys.exit(0) 183 | spec = string.replace('$2', ' ', '') 184 | if spec[[:2]] == '<=': 185 | version_string = spec[[2:]] 186 | elif spec[[:2]] == '>=': 187 | version_string = spec[[2:]] 188 | elif spec[[:1]] == '=': 189 | version_string = spec[[1:]] 190 | elif spec[[:1]] == '>': 191 | version_string = spec[[1:]] 192 | elif spec[[:1]] == '<': 193 | version_string = spec[[1:]] 194 | ver = map(int, string.split(version_string, '.')) 195 | syshexversion = sys.hexversion >> (8 * (4 - l""en(ver))) 196 | verhex = 0 197 | for i in xrange(0, l""en(ver)): verhex = (verhex << 8) + ver[[i]] 198 | print 'sys.hexversion = 0x%08x, verhex = 0x%08x' % (syshexversion, verhex) 199 | if spec[[:2]] == '<=': 200 | status = syshexversion <= verhex 201 | elif spec[[:2]] == '>=': 202 | status = syshexversion >= verhex 203 | elif spec[[:1]] == '=': 204 | status = syshexversion == verhex 205 | elif spec[[:1]] == '>': 206 | status = syshexversion > verhex 207 | elif spec[[:1]] == '<': 208 | status = syshexversion < verhex 209 | else: 210 | status = syshexversion >= verhex 211 | 212 | if status: 213 | sys.exit(0) 214 | else: 215 | sys.exit(1)" 216 | AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) 217 | -------------------------------------------------------------------------------- /config/.svn/text-base/python.m4.svn-base: -------------------------------------------------------------------------------- 1 | ## ------------------------ -*- Autoconf -*- 2 | ## Python file handling 3 | ## From Andrew Dalke 4 | ## Updated by James Henstridge 5 | ## Updated by Ludovic Heyberger (2005), Loic Dachary (2006) 6 | ## ------------------------ 7 | # Copyright (C) 1999, 2000, 2001, 2002, 2003, 2004, 2005 8 | # Free Software Foundation, Inc. 9 | # 10 | # This file is free software; the Free Software Foundation 11 | # gives unlimited permission to copy and/or distribute it, 12 | # with or without modifications, as long as this notice is preserved. 13 | 14 | # AM_PATH_PYTHON([VERSION-CONSTRAINT], [ACTION-IF-FOUND], [ACTION-IF-NOT-FOUND]) 15 | # --------------------------------------------------------------------------- 16 | # Adds support for distributing Python modules and packages. To 17 | # install modules, copy them to $(pythondir), using the python_PYTHON 18 | # automake variable. To install a package with the same name as the 19 | # automake package, install to $(pkgpythondir), or use the 20 | # pkgpython_PYTHON automake variable. 21 | # 22 | # The variables $(pyexecdir) and $(pkgpyexecdir) are provided as 23 | # locations to install python extension modules (shared libraries). 24 | # Another macro is required to find the appropriate flags to compile 25 | # extension modules. 26 | # 27 | # If your package is configured with a different prefix to python, 28 | # users will have to add the install directory to the PYTHONPATH 29 | # environment variable, or create a .pth file (see the python 30 | # documentation for details). 31 | # 32 | # If the VERSION-CONSTRAINT argument is passed, AM_PATH_PYTHON will 33 | # cause an error if the version of python installed on the system 34 | # doesn't meet the requirement. VERSION-CONSTRAINT should consist of 35 | # an operator (>=, <=, =, >, <) followed by a version (1, 2, 2.3, 2.4, 1.5.2 etc.) 36 | # Examples: >2.3, =2.2, >=1.5.1 ... If the operator is omited, it defaults 37 | # to >= (i.e. 2.3 is equivalent to >=2.3) 38 | AC_DEFUN([AM_PATH_PYTHON], 39 | [ 40 | dnl Find a Python interpreter. Python versions prior to 1.5 are not 41 | dnl supported because the default installation locations changed from 42 | dnl $prefix/lib/site-python in 1.4 to $prefix/lib/python1.5/site-packages 43 | dnl in 1.5. 44 | m4_define_default([_AM_PYTHON_INTERPRETER_LIST], 45 | [python python2 python2.5 python2.6 python2.4 python2.3 python2.2 dnl 46 | python2.1 python2.0 python1.6 python1.5]) 47 | 48 | m4_if([$1],[],[ 49 | dnl No version check is needed. 50 | # Find any Python interpreter. 51 | if test -z "$PYTHON"; then 52 | AC_PATH_PROGS([PYTHON], _AM_PYTHON_INTERPRETER_LIST, :) 53 | fi 54 | am_display_PYTHON=python 55 | ], [ 56 | if expr "$1" : "[[<>=]]" > /dev/null ; then 57 | required_version="$1" 58 | elif test -z "$1" || expr "$1" : '[ ]*$' > /dev/null ; then 59 | required_version="" 60 | else 61 | required_version=">=$1" 62 | fi 63 | dnl A version check is needed. 64 | if test -n "$PYTHON"; then 65 | # If the user set $PYTHON, use it and don't search something else. 66 | AC_MSG_CHECKING([whether $PYTHON version $required_version]) 67 | AM_PYTHON_CHECK_VERSION([$PYTHON], [$required_version], 68 | [AC_MSG_RESULT(yes)], 69 | [AC_MSG_ERROR(too old)]) 70 | am_display_PYTHON=$PYTHON 71 | else 72 | # Otherwise, try each interpreter until we find one that satisfies 73 | # VERSION. 74 | AC_MSG_CHECKING([for a Python interpreter with version $required_version]) 75 | for am_cv_pathless_PYTHON in _AM_PYTHON_INTERPRETER_LIST none; do 76 | test "$am_cv_pathless_PYTHON" = none && break 77 | AM_PYTHON_CHECK_VERSION([$am_cv_pathless_PYTHON], [$required_version], [break]) 78 | done 79 | AC_MSG_RESULT([done]) 80 | # Set $PYTHON to the absolute path of $am_cv_pathless_PYTHON. 81 | if test "$am_cv_pathless_PYTHON" = none; then 82 | PYTHON=: 83 | else 84 | unset ac_cv_path_PYTHON 85 | AC_PATH_PROG([PYTHON], [$am_cv_pathless_PYTHON]) 86 | fi 87 | am_display_PYTHON=$am_cv_pathless_PYTHON 88 | fi 89 | ]) 90 | 91 | if test "$PYTHON" = :; then 92 | dnl Run any user-specified action, or abort. 93 | m4_default([$3], [AC_MSG_ERROR([no suitable Python interpreter found for $1])]) 94 | else 95 | 96 | dnl Query Python for its version number. Getting [:3] seems to be 97 | dnl the best way to do this; it's what "site.py" does in the standard 98 | dnl library. 99 | 100 | AC_MSG_CHECKING([for $am_display_PYTHON version]) 101 | am_cv_python_version=`$PYTHON -c "import sys; print sys.version[[:3]]"` 102 | AC_MSG_RESULT([done]) 103 | AC_SUBST([PYTHON_VERSION], [$am_cv_python_version]) 104 | 105 | dnl Use the values of $prefix and $exec_prefix for the corresponding 106 | dnl values of PYTHON_PREFIX and PYTHON_EXEC_PREFIX. These are made 107 | dnl distinct variables so they can be overridden if need be. However, 108 | dnl general consensus is that you shouldn't need this ability. 109 | 110 | AC_SUBST([PYTHON_PREFIX], ['${prefix}']) 111 | AC_SUBST([PYTHON_EXEC_PREFIX], ['${exec_prefix}']) 112 | 113 | dnl At times (like when building shared libraries) you may want 114 | dnl to know which OS platform Python thinks this is. 115 | 116 | AC_MSG_CHECKING([for $am_display_PYTHON platform]) 117 | am_cv_python_platform=`$PYTHON -c "import sys; print sys.platform"` 118 | AC_MSG_RESULT([done]) 119 | AC_SUBST([PYTHON_PLATFORM], [$am_cv_python_platform]) 120 | 121 | 122 | dnl Set up 4 directories: 123 | 124 | dnl pythondir -- where to install python scripts. This is the 125 | dnl site-packages directory, not the python standard library 126 | dnl directory like in previous automake betas. This behavior 127 | dnl is more consistent with lispdir.m4 for example. 128 | dnl Query distutils for this directory. distutils does not exist in 129 | dnl Python 1.5, so we fall back to the hardcoded directory if it 130 | dnl doesn't work. 131 | AC_MSG_CHECKING([for $am_display_PYTHON script directory]) 132 | am_cv_python_pythondir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(0,0,prefix='$PYTHON_PREFIX')" 2>/dev/null || 133 | echo "$PYTHON_PREFIX/lib/python$PYTHON_VERSION/site-packages"` 134 | AC_MSG_RESULT([done]) 135 | AC_SUBST([pythondir], [$am_cv_python_pythondir]) 136 | 137 | dnl pkgpythondir -- $PACKAGE directory under pythondir. Was 138 | dnl PYTHON_SITE_PACKAGE in previous betas, but this naming is 139 | dnl more consistent with the rest of automake. 140 | 141 | AC_SUBST([pkgpythondir], [\${pythondir}/$PACKAGE]) 142 | 143 | dnl pyexecdir -- directory for installing python extension modules 144 | dnl (shared libraries) 145 | dnl Query distutils for this directory. distutils does not exist in 146 | dnl Python 1.5, so we fall back to the hardcoded directory if it 147 | dnl doesn't work. 148 | AC_MSG_CHECKING([for $am_display_PYTHON extension module directory]) 149 | am_cv_python_pyexecdir=`$PYTHON -c "from distutils import sysconfig; print sysconfig.get_python_lib(1,0,prefix='$PYTHON_EXEC_PREFIX')" 2>/dev/null || 150 | echo "${PYTHON_EXEC_PREFIX}/lib/python${PYTHON_VERSION}/site-packages"` 151 | AC_MSG_RESULT([done]) 152 | AC_SUBST([pyexecdir], [$am_cv_python_pyexecdir]) 153 | 154 | dnl pkgpyexecdir -- $(pyexecdir)/$(PACKAGE) 155 | 156 | AC_SUBST([pkgpyexecdir], [\${pyexecdir}/$PACKAGE]) 157 | 158 | dnl Run any user-specified action. 159 | $2 160 | fi 161 | unset am_cv_pathless_PYTHON 162 | unset am_cv_python_version 163 | unset am_cv_python_platform 164 | unset am_cv_python_pythondir 165 | unset am_cv_python_pyexecdir 166 | ]) 167 | 168 | 169 | # AM_PYTHON_CHECK_VERSION(PROG, VERSION-CONSTRAINT, [ACTION-IF-TRUE], [ACTION-IF-FALSE]) 170 | # --------------------------------------------------------------------------- 171 | # Run ACTION-IF-TRUE if the Python interpreter PROG has version that 172 | # satifies VERSION-CONSTRAINT. 173 | # Run ACTION-IF-FALSE otherwise. 174 | # This test uses sys.hexversion instead of the string equivalent (first 175 | # word of sys.version), in order to cope with versions such as 2.2c1. 176 | # hexversion has been introduced in Python 1.5.2; it's probably not 177 | # worth to support older versions (1.5.1 was released on October 31, 1998). 178 | # Do *not* use the operator as it is not available in every supported 179 | # python versions 180 | AC_DEFUN([AM_PYTHON_CHECK_VERSION], 181 | [prog="import sys, string 182 | if '$2' == '': sys.exit(0) 183 | spec = string.replace('$2', ' ', '') 184 | if spec[[:2]] == '<=': 185 | version_string = spec[[2:]] 186 | elif spec[[:2]] == '>=': 187 | version_string = spec[[2:]] 188 | elif spec[[:1]] == '=': 189 | version_string = spec[[1:]] 190 | elif spec[[:1]] == '>': 191 | version_string = spec[[1:]] 192 | elif spec[[:1]] == '<': 193 | version_string = spec[[1:]] 194 | ver = map(int, string.split(version_string, '.')) 195 | syshexversion = sys.hexversion >> (8 * (4 - l""en(ver))) 196 | verhex = 0 197 | for i in xrange(0, l""en(ver)): verhex = (verhex << 8) + ver[[i]] 198 | print 'sys.hexversion = 0x%08x, verhex = 0x%08x' % (syshexversion, verhex) 199 | if spec[[:2]] == '<=': 200 | status = syshexversion <= verhex 201 | elif spec[[:2]] == '>=': 202 | status = syshexversion >= verhex 203 | elif spec[[:1]] == '=': 204 | status = syshexversion == verhex 205 | elif spec[[:1]] == '>': 206 | status = syshexversion > verhex 207 | elif spec[[:1]] == '<': 208 | status = syshexversion < verhex 209 | else: 210 | status = syshexversion >= verhex 211 | 212 | if status: 213 | sys.exit(0) 214 | else: 215 | sys.exit(1)" 216 | AS_IF([AM_RUN_LOG([$1 -c "$prog"])], [$3], [$4])]) 217 | -------------------------------------------------------------------------------- /test.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007, 2008 Loic Dachary 3 | # Copyright (C) 2004, 2005, 2006 Mekensleep 4 | # 5 | # Mekensleep 6 | # 24 rue vieille du temple 7 | # 75004 Paris 8 | # licensing@mekensleep.com 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 3 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 23 | # 24 | # Authors: 25 | # Loic Dachary 26 | # 27 | # 28 | import sys 29 | sys.path.insert(0, ".") 30 | sys.path.insert(0, ".libs") 31 | 32 | from pokereval import PokerEval 33 | 34 | iterations_low = 100000 35 | iterations_high = 200000 36 | 37 | pokereval = PokerEval() 38 | 39 | if pokereval.best_hand_value("hi", ["Ah", "Ad", "As", "Kh", "Ks" ]) != 101494784: 40 | sys.exit(1) 41 | 42 | if pokereval.string2card("2h") != 0: 43 | sys.exit(1) 44 | 45 | print("") 46 | pockets = [ ["As", "Ad", "Ac", "Tc", "Ts", "2d", "5c" ], 47 | ["Js", "Jc", "7s", "8c", "8d", "3c", "3h" ], 48 | [255, 255 ] ] 49 | print("stud7 (1) result = %s\n" % pokereval.winners(game = "7stud", pockets = pockets, dead = [], board = [])) 50 | 51 | pockets = [[22, 18, 21, 3, 41, 1, 30], [39, 255, 255, 15, 13, 17, 255]] 52 | print("stud7 (2) result = %s\n" % pokereval.winners(game = "7stud", pockets = pockets, dead = [], board = [])) 53 | 54 | print([ j + i + "/%d" % pokereval.string2card(j + i) for i in "hdcs" for j in "23456789TJQKA" ]) 55 | print("deck = %s\n" % pokereval.deck()) 56 | 57 | print("result = %s\n" % pokereval.poker_eval(game = "holdem", pockets = [ ["tc", "ac"], ["3h", "ah"], ["8c", "6h"]], dead = [], board = ["7h", "3s", "2c"])) 58 | print("winners = %s\n" % pokereval.winners(game = "holdem", pockets = [ ["tc", "ac"], ["3h", "ah"], ["8c", "6h"]], dead = [], board = ["7h", "3s", "2c"])) 59 | 60 | print("result = %s\n" % pokereval.poker_eval(game = "holdem", pockets = [ ["tc", "ac"], ["th", "ah"], ["8c", "6h"]], dead = [], board = ["7h", "3s", "2c", "7s", "7d"])) 61 | print("winners = %s\n" % pokereval.winners(game = "holdem", pockets = [ ["tc", "ac"], ["th", "ah"], ["8c", "6h"]], dead = [], board = ["7h", "3s", "2c", "7s", "7d"])) 62 | 63 | print("winners (filthy pockets) = %s\n" % pokereval.winners(game = "holdem", pockets = [ ["tc", "ac", 255], [], [255, 255], ["th", "ah"], ["8c", "6h"]], dead = [], board = ["7h", "3s", "2c", "7s", "7d"])) 64 | 65 | print("winners omaha = %s\n" % pokereval.winners(game = "omaha", pockets = [ ["tc", "ac", "ks", "kc" ], ["th", "ah", "qs", "qc" ], ["8c", "6h", "js", "jc" ]], dead = [], board = ["7h", "3s", "2c", "7s", "7d"])) 66 | print("winners omaha8 = %s\n" % pokereval.winners(game = "omaha8", pockets = [ ["tc", "ac", "ks", "kc" ], ["th", "ah", "qs", "qc" ], ["8c", "6h", "js", "jc" ]], dead = [], board = ["7h", "3s", "2c", "7s", "7d"])) 67 | 68 | hand = ["Ac", "As", "Td", "7s", "7h", "3s", "2c"] 69 | best_hand = pokereval.best_hand("hi", hand) 70 | print("best hand from %s = %s" % ( hand, pokereval.best_hand("hi", hand) )) 71 | print("best hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 72 | 73 | print("") 74 | hand = ["Ah", "Ts", "Kh", "Qs", "Js" ] 75 | best_hand = pokereval.best_hand("hi", hand) 76 | print("best hand from %s = %s" % ( hand, pokereval.best_hand("hi", hand) )) 77 | print("best hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 78 | 79 | print("") 80 | hand = ["2h", "Kh", "Qh", "Jh", "Th" ] 81 | best_hand = pokereval.best_hand("hi", hand) 82 | print("best hand from %s = %s" % ( hand, pokereval.best_hand("hi", hand) )) 83 | print("best hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 84 | 85 | print("") 86 | hand = ['2s', '3s', 'Jd', 'Ks', 'As', '4d', '5h', '7d', '9c'] 87 | best_hand = pokereval.best_hand("hi", hand) 88 | print("best hand from %s = %s" % ( hand, pokereval.best_hand("hi", hand) )) 89 | print("best hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 90 | 91 | print("") 92 | hand = ['As', '2s', '4d', '4s', '5c', '5d', '7s'] 93 | best_hand = pokereval.best_hand("low", hand) 94 | print("1/ low hand from %s = %s" % ( hand, pokereval.best("low", hand) )) 95 | print("best low hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 96 | 97 | print("") 98 | hand = ['As', '2s', '4d', '4s', '5c', '5d', '8s'] 99 | best_hand = pokereval.best_hand("low", hand) 100 | print("2/ low hand from %s = %s" % ( hand, pokereval.best("low", hand) )) 101 | print("best low hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 102 | 103 | print("") 104 | hand = ['7d', '6c', '5h', '4d', 'As'] 105 | best_hand = pokereval.best_hand("low", hand) 106 | print("3/ low hand from %s = %s" % ( hand, pokereval.best("low", hand) )) 107 | print("best low hand from %s = (%s) %s " % (hand, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 108 | 109 | print("") 110 | board = [ 'As', '4d', '5h', '7d', '9c' ] 111 | hand = [ '2s', 'Ts', 'Jd', 'Ks' ] 112 | best_hand = pokereval.best_hand("low", hand, board) 113 | print("4/ low hand from %s / %s = %s" % ( hand, board, pokereval.best("low", hand, board) )) 114 | print("best low hand from %s / %s = (%s) %s " % (hand, board, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 115 | 116 | print("") 117 | board = [ 'As', '4d', '6h', '7d', '3c' ] 118 | hand = [ '2s', '5s', 'Jd', 'Ks' ] 119 | best_hand = pokereval.best_hand("low", hand, board) 120 | print("low hand from %s / %s = %s" % ( hand, board, pokereval.best("low", hand, board) )) 121 | print("best low hand from %s / %s = (%s) %s " % (hand, board, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 122 | 123 | print("") 124 | board = [ 'Jc', '4c', '3c', '5c', '9c' ] 125 | hand = [ '2c', 'Ac', '5h', '9d' ] 126 | best_hand = pokereval.best_hand("hi", hand, board) 127 | print("hi hand from %s / %s = %s" % ( hand, board, pokereval.best("hi", hand, board) )) 128 | print("best hi hand from %s / %s = (%s) %s " % (hand, board, best_hand[0], pokereval.card2string(best_hand[1:]))) 129 | 130 | print("") 131 | board = [ 'Jd', '9c', 'Jc', 'Tc', '2h' ] 132 | hand = [ '2c', '4c', 'Th', '6s' ] 133 | best_hand = pokereval.best_hand("low", hand, board) 134 | print("5/ low hand from %s / %s = %s" % ( hand, board, pokereval.best("low", hand, board) )) 135 | print("best low hand from %s / %s = (%s) %s " % (hand, board, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 136 | 137 | print("") 138 | board = [ 'Ks', 'Jd', '7s', '4d', 'Js' ] 139 | hand = [ '2d', '6c', 'Ac', '5c' ] 140 | best_hand = pokereval.best_hand("low", hand, board) 141 | print("6/ low hand from %s / %s = %s" % ( hand, board, pokereval.best("low", hand, board) )) 142 | print("best low hand from %s / %s = (%s) %s " % (hand, board, best_hand[0], [ pokereval.card2string(i) for i in best_hand[1:] ])) 143 | 144 | if len(sys.argv) > 2: 145 | 146 | print("f0 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, pockets = [ ["As", "3s"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "Qs", "2c", "Ac", "Kc"])) 147 | 148 | print("") 149 | print("f1 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, pockets = [ ["As", "3s"], ["__", "__"], ["__", "__"]], dead = [], board = ["7s", "Qs", "2c", "Ac", "Kc"])) 150 | 151 | 152 | print("") 153 | print("f2 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, iterations = iterations_low, pockets = [ ["As", "3s"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 154 | 155 | print("") 156 | print("f3 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, iterations = iterations_high, pockets = [ ["As", "Ac"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 157 | 158 | print("") 159 | print("f4 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, iterations = iterations_high, pockets = [ ["As", "Ks"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 160 | 161 | print("") 162 | print("f5 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, iterations = iterations_high, pockets = [ ["2s", "2c"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 163 | 164 | print("") 165 | print("f6 result = %s\n" % pokereval.poker_eval(game = "holdem", fill_pockets = 1, iterations = iterations_high, pockets = [ ["Js", "Jc"], ["__", "__"], ["__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 166 | 167 | print("") 168 | print("f7 result = %s\n" % pokereval.poker_eval(game = "omaha", fill_pockets = 1, iterations = iterations_high, pockets = [ ["Js", "Jc", "7s", "8c"], ["__", "__", "__", "__"], ["__", "__", "__", "__"]], dead = [], board = ["__", "__", "__", "__", "__"])) 169 | 170 | print("") 171 | hand = ['As', 'Ad'] 172 | print("handval %s = %d " % (hand, pokereval.evaln(hand))) 173 | 174 | print("") 175 | hand = ['Qc', '7d'] 176 | print("handval %s = %d " % (hand, pokereval.evaln(hand))) 177 | 178 | pokereval = None 179 | -------------------------------------------------------------------------------- /pokereval.py: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2007, 2008 Loic Dachary 3 | # Copyright (C) 2004, 2005, 2006 Mekensleep 4 | # 5 | # Mekensleep 6 | # 24 rue vieille du temple 7 | # 75004 Paris 8 | # licensing@mekensleep.com 9 | # 10 | # This program is free software; you can redistribute it and/or modify 11 | # it under the terms of the GNU General Public License as published by 12 | # the Free Software Foundation; either version 3 of the License, or 13 | # (at your option) any later version. 14 | # 15 | # This program is distributed in the hope that it will be useful, 16 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 17 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 | # GNU General Public License for more details. 19 | # 20 | # You should have received a copy of the GNU General Public License 21 | # along with this program; if not, write to the Free Software 22 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 23 | # 24 | # Authors: 25 | # Loic Dachary 26 | # 27 | # 28 | import sys 29 | _pokereval = __import__('_pokereval_' + sys.version[0] + '_' + sys.version[2]) 30 | 31 | if sys.version_info[0] < 3: 32 | from types import ListType, TupleType 33 | else: 34 | ListType, TupleType = list, tuple 35 | xrange = range 36 | 37 | class PokerEval: 38 | """\ 39 | Evaluate the strengh of a poker hand for a given poker variant. 40 | In all methods, when a list of cards is to be provided (for instance 41 | with the "hand" argument of the "best" method), each member of the 42 | list may be a number or a string designating a card according to 43 | the following table: 44 | 45 | 2h/00 2d/13 2c/26 2s/39 46 | 3h/01 3d/14 3c/27 3s/40 47 | 4h/02 4d/15 4c/28 4s/41 48 | 5h/03 5d/16 5c/29 5s/42 49 | 6h/04 6d/17 6c/30 6s/43 50 | 7h/05 7d/18 7c/31 7s/44 51 | 8h/06 8d/19 8c/32 8s/45 52 | 9h/07 9d/20 9c/33 9s/46 53 | Th/08 Td/21 Tc/34 Ts/47 54 | Jh/09 Jd/22 Jc/35 Js/48 55 | Qh/10 Qd/23 Qc/36 Qs/49 56 | Kh/11 Kd/24 Kc/37 Ks/50 57 | Ah/12 Ad/25 Ac/38 As/51 58 | 59 | The string __ (two underscore) or the number 255 are placeholders 60 | meaning that the card is unknown. 61 | """ 62 | 63 | def best(self, side, hand, board = []): 64 | """\ 65 | Return the best five card combination that can be made with the cards 66 | listed in "hand" and, optionally, board. The "side" may be "hi" or 67 | "low". The "board" argument must only be provided for variants where 68 | knowing if a given card is taken from the board or not is significant 69 | (such as Omaha but not Holdem). 70 | 71 | A list is returned. The first element is the numerical value 72 | of the hand (better hands have higher values if "side" is "hi" and 73 | lower values if "side" is "low"). The second element is a list whose 74 | first element is the strength of the hand among the following: 75 | 76 | Nothing (only if "side" equals "low") 77 | NoPair 78 | TwoPair 79 | Trips 80 | Straight 81 | Flush 82 | FlHouse 83 | Quads 84 | StFlush 85 | 86 | The last five elements are numbers describing the best hand properly 87 | sorted (for instance the ace is at the end for no pair if "side" is low or 88 | at the beginning if "side" high). 89 | 90 | Examples: 91 | 92 | [134414336, ['StFlush', 29, 28, 27, 26, 38]] is the wheel five to ace, clubs 93 | [475920, ['NoPair', 45, 29, 41, 39, 51]] is As, 8s, 5c, 4s, 2s 94 | [268435455, ['Nothing']] means there is no qualifying low 95 | """ 96 | if len(hand + board) >= 5: 97 | return _pokereval.eval_hand(side, hand, board) 98 | else: 99 | return False 100 | 101 | def best_hand(self, side, hand, board = []): 102 | """\ 103 | Return the best five card combination that can be made with the cards 104 | listed in "hand" and, optionaly, board. The "side" may be "hi" or 105 | "low". The returned value is the second element of the list returned 106 | by the "best" method. 107 | """ 108 | if len(hand + board) >= 5: 109 | return _pokereval.eval_hand(side, hand, board)[1] 110 | else: 111 | return False 112 | 113 | def best_hand_value(self, side, hand, board = []): 114 | """\ 115 | Return the best five card combination that can be made with the cards 116 | listed in "hand" and, optionaly, board. The "side" may be "hi" or 117 | "low". The returned value is the first element of the list returned 118 | by the "best" method. 119 | """ 120 | if len(hand + board) >= 5: 121 | return _pokereval.eval_hand(side, hand, board)[0] 122 | else: 123 | return False 124 | 125 | def evaln(self, cards): 126 | """\ 127 | Call the poker-eval Hand_EVAL_N function with the "cards" argument. 128 | Return the strength of the "cards" as a number. The higher the 129 | better. 130 | """ 131 | return _pokereval.evaln(cards) 132 | 133 | def winners(self, *args, **kwargs): 134 | """\ 135 | Return a list of the indexes of the best hands, relative to the "pockets" 136 | keyword argument. For instance, if the first pocket and third pocket cards 137 | tie, the list would be [0, 2]. Since there may be more than one way to 138 | win a hand, a hash is returned with the list of the winners for each so 139 | called side. For instace {'hi': [0], 'low': [1]} means pocket cards 140 | at index 0 won the high side of the hand and pocket cards at index 1 141 | won the low side. 142 | 143 | See the"poker_eval" method for a detailed 144 | explanation of the semantics of the arguments. 145 | 146 | If the keyword argument "fill_pockets" is set, pocket cards 147 | can contain a placeholder (i.e. 255 or __) that will be be 148 | used as specified in the "poker_eval" method documentation. 149 | 150 | If the keyword argument "fill_pockets" is not set, pocket cards 151 | that contain at least one placeholder (i.e. 255 or __) are 152 | ignored completly. For instance if winners is called as follows 153 | o.winners(game = 'holdem', pockets = [ [ '__', 'As' ], [ 'Ks', 'Kd'] ]) 154 | it is strictly equivalent as calling 155 | o.winners(game = 'holdem', pockets = [ [ 'Ks', 'Kd'] ]). 156 | """ 157 | index2index = {} 158 | normalized_pockets = [] 159 | normalized_index = 0 160 | pockets = kwargs["pockets"][:] 161 | for index in xrange(len(pockets)): 162 | if "fill_pockets" not in kwargs: 163 | if 255 in pockets[index] or "__" in pockets[index]: 164 | pockets[index] = [] 165 | 166 | if pockets[index] != []: 167 | normalized_pockets.append(pockets[index]) 168 | index2index[index] = normalized_index 169 | normalized_index += 1 170 | kwargs["pockets"] = normalized_pockets 171 | 172 | results = _pokereval.poker_eval(*args, **kwargs) 173 | 174 | (count, haslopot, hashipot) = results.pop(0) 175 | winners = { 'low': [], 'hi': [] } 176 | for index in xrange(len(pockets)): 177 | if index in index2index: 178 | result = results[index2index[index]] 179 | if result[1] == 1 or result[3] == 1: 180 | winners["hi"].append(index) 181 | if result[4] == 1 or result[6] == 1: 182 | winners["low"].append(index) 183 | 184 | if not haslopot or len(winners["low"]) == 0: 185 | del winners["low"] 186 | if not hashipot: 187 | del winners["hi"] 188 | return winners 189 | 190 | def poker_eval(self, *args, **kwargs): 191 | """\ 192 | Provided with a description of a poker game, return the outcome (if at showdown) or 193 | the expected value of each hand. The poker game description is provided as a set 194 | of keyword arguments with the following meaning: 195 | 196 | game : the variant (holdem, holdem8, omaha, omaha8, 7stud, 7stud8, razz, 197 | 5draw, 5draw8, 5drawnsq, lowball, lowball27). 198 | Mandatory, no default. 199 | 200 | pockets : list of pocket cards for each player still in game. Each member 201 | of the list is a list of cards. The position of the pocket cards 202 | in the list is meaningfull for the value returned will refer to 203 | this position when stating which player wins, tie or loose. 204 | Example: [ ["tc", "ac"], ["3h", "ah"], ["8c", "6h"]] 205 | Cards do not have to be real cards like "tc" or "4s". They may also be a 206 | placeholder, denoted by "__" or 255. When using placeholders, the 207 | keyword argument "iterations" may be specified to use Monte Carlo instead of 208 | exhaustive exploration of all the possible combinations. 209 | Example2: [ ["tc", "__"], [255, "ah"], ["8c", "6h"]] 210 | 211 | Mandatory, no default. 212 | 213 | board : list of community cards, for games where this is meaningfull. If 214 | specified when irrelevant, the return value cannot be predicted. 215 | Default: [] 216 | 217 | dead : list of dead cards. These cards won't be accounted for when exloring 218 | the possible hands. 219 | Default: [] 220 | 221 | iterations: the maximum number of iterations when exploring the 222 | possible outcome of a given hand. Roughly speaking, each 223 | iteration means to distribute cards that are missing (for 224 | which there are place holders in the board or pockets 225 | keywords arguments, i.e. 255 or __). If the number of 226 | iterations is not specified and there are place holders, 227 | the return value cannot be predicted. 228 | Default: +infinite (i.e. exhaustive exploration) 229 | 230 | Example: object.poker_eval(game = "holdem", 231 | pockets = [ ["tc", "ac"], ["3h", "ah"], ["8c", "6h"]], 232 | dead = [], 233 | board = ["7h", "3s", "2c"]) 234 | 235 | The return value is a map of two entries: 236 | 'info' contains three integers: 237 | - the number of samples (which must be equal to the number of iterations given 238 | in argument). 239 | - 1 if the game has a low side, 0 otherwise 240 | - 1 if the game has a high side, 0 otherwise 241 | 'eval' is a list of as many maps as there are pocket cards, each 242 | made of the following entries: 243 | 'scoop': the number of time these pocket cards scoop 244 | 'winhi': the number of time these pocket cards win the high side 245 | 'losehi': the number of time these pocket cards lose the high side 246 | 'tiehi': the number of time these pocket cards tie for the high side 247 | 'winlo': the number of time these pocket cards win the low side 248 | 'loselo': the number of time these pocket cards lose the low side 249 | 'tielo': the number of time these pocket cards tie for the low side 250 | 'ev': the EV of these pocket cards as an int in the range [0,1000] with 251 | 1000 being the best. 252 | 253 | It should be clear that if there is only one sample (i.e. because all the 254 | cards are known which is the situation that occurs at showdown) the details 255 | provided by the 'eval' entry is mostly irrelevant and the caller might 256 | prefer to call the winners method instead. 257 | """ 258 | result = _pokereval.poker_eval(*args, **kwargs) 259 | return { 260 | 'info': result[0], 261 | 'eval': [ { 'scoop': x[0], 262 | 'winhi': x[1], 263 | 'losehi': x[2], 264 | 'tiehi': x[3], 265 | 'winlo': x[4], 266 | 'loselo': x[5], 267 | 'tielo': x[6], 268 | 'ev': int(x[7] * 1000) } for x in result[1:] ] 269 | } 270 | 271 | def deck(self): 272 | """\ 273 | Return the list of all cards in the deck. 274 | """ 275 | return [ self.string2card(i + j) for i in "23456789TJQKA" for j in "hdcs" ] 276 | 277 | def nocard(self): 278 | """Return 255, the numerical value of a place holder in a list of cards.""" 279 | return 255 280 | 281 | def string2card(self, cards): 282 | """\ 283 | Convert card names (strings) to card numbers (integers) according to the 284 | following map: 285 | 286 | 2h/00 2d/13 2c/26 2s/39 287 | 3h/01 3d/14 3c/27 3s/40 288 | 4h/02 4d/15 4c/28 4s/41 289 | 5h/03 5d/16 5c/29 5s/42 290 | 6h/04 6d/17 6c/30 6s/43 291 | 7h/05 7d/18 7c/31 7s/44 292 | 8h/06 8d/19 8c/32 8s/45 293 | 9h/07 9d/20 9c/33 9s/46 294 | Th/08 Td/21 Tc/34 Ts/47 295 | Jh/09 Jd/22 Jc/35 Js/48 296 | Qh/10 Qd/23 Qc/36 Qs/49 297 | Kh/11 Kd/24 Kc/37 Ks/50 298 | Ah/12 Ad/25 Ac/38 As/51 299 | 300 | The "cards" argument may be either a list in which case a converted list 301 | is returned or a string in which case the corresponding number is 302 | returned. 303 | """ 304 | if isinstance(cards, ListType) or isinstance(cards, TupleType): 305 | return [ _pokereval.string2card(card) for card in cards ] 306 | else: 307 | return _pokereval.string2card(cards) 308 | 309 | def card2string(self, cards): 310 | """\ 311 | Convert card numbers (integers) to card names (strings) according to the 312 | following map: 313 | 314 | 2h/00 2d/13 2c/26 2s/39 315 | 3h/01 3d/14 3c/27 3s/40 316 | 4h/02 4d/15 4c/28 4s/41 317 | 5h/03 5d/16 5c/29 5s/42 318 | 6h/04 6d/17 6c/30 6s/43 319 | 7h/05 7d/18 7c/31 7s/44 320 | 8h/06 8d/19 8c/32 8s/45 321 | 9h/07 9d/20 9c/33 9s/46 322 | Th/08 Td/21 Tc/34 Ts/47 323 | Jh/09 Jd/22 Jc/35 Js/48 324 | Qh/10 Qd/23 Qc/36 Qs/49 325 | Kh/11 Kd/24 Kc/37 Ks/50 326 | Ah/12 Ad/25 Ac/38 As/51 327 | 328 | The "cards" argument may be either a list in which case a converted list 329 | is returned or an integer in which case the corresponding string is 330 | returned. 331 | """ 332 | if isinstance(cards, ListType) or isinstance(cards, TupleType): 333 | return [ _pokereval.card2string(card) for card in cards ] 334 | else: 335 | return _pokereval.card2string(cards) 336 | 337 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /pypokereval.c: -------------------------------------------------------------------------------- 1 | /* 2 | * 3 | * Copyright (C) 2007, 2008 Loic Dachary 4 | * Copyright (C) 2004, 2005, 2006 Mekensleep 5 | * 6 | * Mekensleep 7 | * 24 rue vieille du temple 8 | * 75004 Paris 9 | * licensing@mekensleep.com 10 | * 11 | * This program is free software; you can redistribute it and/or modify 12 | * it under the terms of the GNU General Public License as published by 13 | * the Free Software Foundation; either version 3 of the License, or 14 | * (at your option) any later version. 15 | * 16 | * This program is distributed in the hope that it will be useful, 17 | * but WITHOUT ANY WARRANTY; without even the implied warranty of 18 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 19 | * GNU General Public License for more details. 20 | * 21 | * You should have received a copy of the GNU General Public License 22 | * along with this program; if not, write to the Free Software 23 | * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. 24 | * 25 | * Authors: 26 | * Loic Dachary 27 | * 28 | */ 29 | 30 | #ifdef _DEBUG // for Windows python23_d.lib is not in distribution... ugly but works 31 | #undef _DEBUG 32 | #include 33 | #define _DEBUG 34 | #else 35 | #include 36 | #endif 37 | #include 38 | 39 | #if PY_MAJOR_VERSION >= 3 40 | #define IS_PY3K 41 | #endif 42 | 43 | struct module_state { 44 | PyObject *error; 45 | }; 46 | 47 | #ifdef IS_PY3K 48 | #define GETSTATE(m) ((struct module_state*)PyModule_GetState(m)) 49 | #define PyInteger_Check PyLong_Check 50 | #define PyInteger_AsLong PyLong_AsLong 51 | #else 52 | #define GETSTATE(m) (&_state) 53 | static struct module_state _state; 54 | #define PyInteger_Check PyInt_Check 55 | #define PyInteger_AsLong PyInt_AsLong 56 | #endif 57 | 58 | /* enumerate.c -- functions to compute pot equity by enumerating outcomes 59 | Exports: 60 | enumExhaustive() exhaustive enumeration of outcomes 61 | enumGameParams() look up rule parameters by game type 62 | enumResultClear() clear enumeration result object 63 | enumResultPrint() print enumeration result object 64 | enumResultPrintTerse() print enumeration result object, tersely 65 | enumSample() monte carlo sampling of outcomes 66 | 67 | Michael Maurer, Apr 2002 68 | */ 69 | 70 | #include "poker_defs.h" 71 | #include "inlines/eval.h" 72 | #include "inlines/eval_low.h" 73 | #include "inlines/eval_low8.h" 74 | #include "inlines/eval_joker_low.h" 75 | #include "inlines/eval_omaha.h" 76 | #include "deck_std.h" 77 | #include "rules_std.h" 78 | 79 | #include "enumerate.h" 80 | #include "enumdefs.h" 81 | 82 | #ifdef WIN32 83 | #define VERSION_NAME(W) W##2_4 84 | #define PYTHON_VERSION "2_4" 85 | #endif /* WIN32 */ 86 | 87 | /* INNER_LOOP is executed in every iteration of the combinatorial enumerator 88 | macros DECK_ENUMERATE_n_CARDS_D() and DECK_ENUMERATE_PERMUTATIONS_D. It 89 | evaluates each player's hand based on the enumerated community cards and 90 | accumulates statistics on wins, ties, losses, and pot equity. 91 | 92 | Macro argument: 93 | evalwrap -- code that evaluates pockets[i], board, sharedCards, and/or 94 | unsharedCards[i] as a poker hand, then stores the result 95 | in hival[i] and loval[i] and stores an error code in err 96 | Loop variable: either of 97 | StdDeck_CardMask sharedCards; 98 | StdDeck_CardMask unsharedCards[]; 99 | Inputs: 100 | StdDeck_CardMask pockets[]; 101 | StdDeck_CardMask board; 102 | int npockets; 103 | Outputs: 104 | enum_result_t *result; 105 | */ 106 | 107 | #define INNER_LOOP(evalwrap) \ 108 | do { \ 109 | int i; \ 110 | HandVal hival[ENUM_MAXPLAYERS]; \ 111 | LowHandVal loval[ENUM_MAXPLAYERS]; \ 112 | HandVal besthi = HandVal_NOTHING; \ 113 | LowHandVal bestlo = LowHandVal_NOTHING; \ 114 | int hishare = 0; \ 115 | int loshare = 0; \ 116 | double hipot, lopot; \ 117 | /* find winning hands for high and low */ \ 118 | for (i=0; i besthi) { \ 125 | besthi = hival[i]; \ 126 | hishare = 1; \ 127 | } else if (hival[i] == besthi) { \ 128 | hishare++; \ 129 | } \ 130 | } \ 131 | if (loval[i] != LowHandVal_NOTHING) { \ 132 | if (loval[i] < bestlo) { \ 133 | bestlo = loval[i]; \ 134 | loshare = 1; \ 135 | } else if (loval[i] == bestlo) { \ 136 | loshare++; \ 137 | } \ 138 | } \ 139 | } \ 140 | /* now award pot fractions to winning hands */ \ 141 | if (bestlo != LowHandVal_NOTHING && \ 142 | besthi != HandVal_NOTHING) { \ 143 | hipot = 0.5 / hishare; \ 144 | lopot = 0.5 / loshare; \ 145 | } else if (bestlo == LowHandVal_NOTHING && \ 146 | besthi != HandVal_NOTHING) { \ 147 | hipot = 1.0 / hishare; \ 148 | lopot = 0; \ 149 | } else if (bestlo != LowHandVal_NOTHING && \ 150 | besthi == HandVal_NOTHING) { \ 151 | hipot = 0; \ 152 | lopot = 1.0 / loshare; \ 153 | } else { \ 154 | hipot = lopot = 0; \ 155 | } \ 156 | for (i=0; inwinhi[i]++; \ 165 | else \ 166 | result->ntiehi[i]++; \ 167 | } else { \ 168 | result->nlosehi[i]++; \ 169 | } \ 170 | } \ 171 | if (loval[i] != LowHandVal_NOTHING) { \ 172 | if (loval[i] == bestlo) { \ 173 | L = loshare; \ 174 | potfrac += lopot; \ 175 | if (loshare == 1) \ 176 | result->nwinlo[i]++; \ 177 | else \ 178 | result->ntielo[i]++; \ 179 | } else { \ 180 | result->nloselo[i]++; \ 181 | } \ 182 | } \ 183 | result->nsharehi[i][H]++; \ 184 | result->nsharelo[i][L]++; \ 185 | result->nshare[i][H][L]++; \ 186 | if (potfrac > 0.99) \ 187 | result->nscoop[i]++; \ 188 | result->ev[i] += potfrac; \ 189 | } \ 190 | result->nsamples++; \ 191 | } while (0); 192 | 193 | #define INNER_LOOP_ANY_HIGH \ 194 | INNER_LOOP({ \ 195 | StdDeck_CardMask _hand; \ 196 | StdDeck_CardMask _finalBoard; \ 197 | StdDeck_CardMask_RESET(_hand); \ 198 | StdDeck_CardMask_RESET(_finalBoard); \ 199 | StdDeck_CardMask_OR(_finalBoard, board, cardsDealt[0]); \ 200 | StdDeck_CardMask_OR(_hand, pockets[i], _finalBoard); \ 201 | StdDeck_CardMask_OR(_hand, _hand, cardsDealt[i + 1]); \ 202 | hival[i] = StdDeck_StdRules_EVAL_N(_hand, 7); \ 203 | loval[i] = LowHandVal_NOTHING; \ 204 | err = 0; \ 205 | }) 206 | 207 | #define INNER_LOOP_ANY_HILO \ 208 | INNER_LOOP({ \ 209 | StdDeck_CardMask _hand; \ 210 | StdDeck_CardMask _finalBoard; \ 211 | StdDeck_CardMask_RESET(_hand); \ 212 | StdDeck_CardMask_RESET(_finalBoard); \ 213 | StdDeck_CardMask_OR(_finalBoard, board, cardsDealt[0]); \ 214 | StdDeck_CardMask_OR(_hand, pockets[i], _finalBoard); \ 215 | StdDeck_CardMask_OR(_hand, _hand, cardsDealt[i + 1]); \ 216 | hival[i] = StdDeck_StdRules_EVAL_N(_hand, 7); \ 217 | loval[i] = StdDeck_Lowball8_EVAL(_hand, 7); \ 218 | err = 0; \ 219 | }) 220 | 221 | #define INNER_LOOP_OMAHA \ 222 | INNER_LOOP({ \ 223 | StdDeck_CardMask _hand; \ 224 | StdDeck_CardMask _finalBoard; \ 225 | StdDeck_CardMask_RESET(_hand); \ 226 | StdDeck_CardMask_RESET(_finalBoard); \ 227 | StdDeck_CardMask_OR(_finalBoard, board, cardsDealt[0]); \ 228 | StdDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 229 | err = StdDeck_OmahaHiLow8_EVAL(_hand, _finalBoard, \ 230 | &hival[i], NULL); \ 231 | loval[i] = LowHandVal_NOTHING; \ 232 | }) 233 | 234 | #define INNER_LOOP_OMAHA8 \ 235 | INNER_LOOP({ \ 236 | StdDeck_CardMask _hand; \ 237 | StdDeck_CardMask _finalBoard; \ 238 | StdDeck_CardMask_RESET(_hand); \ 239 | StdDeck_CardMask_RESET(_finalBoard); \ 240 | StdDeck_CardMask_OR(_finalBoard, board, cardsDealt[0]); \ 241 | StdDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 242 | err = StdDeck_OmahaHiLow8_EVAL(_hand, _finalBoard, \ 243 | &hival[i], &loval[i]); \ 244 | }) 245 | 246 | #define INNER_LOOP_7STUDNSQ \ 247 | INNER_LOOP({ \ 248 | StdDeck_CardMask _hand; \ 249 | StdDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 250 | hival[i] = StdDeck_StdRules_EVAL_N(_hand, 7); \ 251 | loval[i] = StdDeck_Lowball_EVAL(_hand, 7); \ 252 | err = 0; \ 253 | }) 254 | 255 | #define INNER_LOOP_RAZZ \ 256 | INNER_LOOP({ \ 257 | StdDeck_CardMask _hand; \ 258 | StdDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 259 | hival[i] = HandVal_NOTHING; \ 260 | loval[i] = StdDeck_Lowball_EVAL(_hand, 7); \ 261 | err = 0; \ 262 | }) 263 | 264 | #define INNER_LOOP_5DRAW \ 265 | INNER_LOOP({ \ 266 | JokerDeck_CardMask _hand; \ 267 | JokerDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 268 | hival[i] = JokerDeck_JokerRules_EVAL_N(_hand, 5); \ 269 | loval[i] = LowHandVal_NOTHING; \ 270 | err = 0; \ 271 | }) 272 | 273 | #define INNER_LOOP_5DRAW8 \ 274 | INNER_LOOP({ \ 275 | JokerDeck_CardMask _hand; \ 276 | JokerDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 277 | hival[i] = JokerDeck_JokerRules_EVAL_N(_hand, 5); \ 278 | loval[i] = JokerDeck_Lowball8_EVAL(_hand, 5); \ 279 | err = 0; \ 280 | }) 281 | 282 | #define INNER_LOOP_5DRAWNSQ \ 283 | INNER_LOOP({ \ 284 | JokerDeck_CardMask _hand; \ 285 | JokerDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 286 | hival[i] = JokerDeck_JokerRules_EVAL_N(_hand, 5); \ 287 | loval[i] = JokerDeck_Lowball_EVAL(_hand, 5); \ 288 | err = 0; \ 289 | }) 290 | 291 | #define INNER_LOOP_LOWBALL \ 292 | INNER_LOOP({ \ 293 | JokerDeck_CardMask _hand; \ 294 | JokerDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 295 | hival[i] = HandVal_NOTHING; \ 296 | loval[i] = JokerDeck_Lowball_EVAL(_hand, 5); \ 297 | err = 0; \ 298 | }) 299 | 300 | #define INNER_LOOP_LOWBALL27 \ 301 | INNER_LOOP({ \ 302 | StdDeck_CardMask _hand; \ 303 | StdDeck_CardMask_OR(_hand, pockets[i], cardsDealt[i + 1]); \ 304 | hival[i] = HandVal_NOTHING; \ 305 | loval[i] = StdDeck_StdRules_EVAL_N(_hand, 5); \ 306 | err = 0; \ 307 | }) 308 | 309 | static int 310 | pyenumExhaustive(enum_game_t game, StdDeck_CardMask pockets[], 311 | int numToDeal[], 312 | StdDeck_CardMask board, StdDeck_CardMask dead, 313 | int sizeToDeal, enum_result_t *result) { 314 | int totalToDeal = 0; 315 | int i; 316 | enumResultClear(result); 317 | StdDeck_CardMask cardsDealt[ENUM_MAXPLAYERS + 1]; 318 | memset(cardsDealt, 0, sizeof(StdDeck_CardMask) * (ENUM_MAXPLAYERS + 1)); 319 | if (sizeToDeal - 1 > ENUM_MAXPLAYERS) 320 | return 1; 321 | for(i = 0; i < sizeToDeal; i++) 322 | totalToDeal += numToDeal[i]; 323 | 324 | /* 325 | * Cards in pockets or in the board must not be dealt 326 | */ 327 | StdDeck_CardMask_OR(dead, dead, board); 328 | for(i = 0; i < sizeToDeal - 1; i++) { 329 | StdDeck_CardMask_OR(dead, dead, pockets[i]); 330 | } 331 | 332 | if (game == game_holdem) { 333 | if(totalToDeal > 0) { 334 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 335 | sizeToDeal, numToDeal, 336 | dead, INNER_LOOP_ANY_HIGH); 337 | } else { 338 | INNER_LOOP_ANY_HIGH; 339 | } 340 | } else if (game == game_holdem8) { 341 | if(totalToDeal > 0) { 342 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 343 | sizeToDeal, numToDeal, 344 | dead, INNER_LOOP_ANY_HILO); 345 | } else { 346 | INNER_LOOP_ANY_HILO; 347 | } 348 | } else if (game == game_omaha) { 349 | if(totalToDeal > 0) { 350 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 351 | sizeToDeal, numToDeal, 352 | dead, INNER_LOOP_OMAHA); 353 | } else { 354 | INNER_LOOP_OMAHA; 355 | } 356 | } else if (game == game_omaha8) { 357 | if(totalToDeal > 0) { 358 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 359 | sizeToDeal, numToDeal, 360 | dead, INNER_LOOP_OMAHA8); 361 | } else { 362 | INNER_LOOP_OMAHA8; 363 | } 364 | } else if (game == game_7stud) { 365 | if(totalToDeal > 0) { 366 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 367 | sizeToDeal, numToDeal, 368 | dead, INNER_LOOP_ANY_HIGH); 369 | } else { 370 | INNER_LOOP_ANY_HIGH; 371 | } 372 | } else if (game == game_7stud8) { 373 | if(totalToDeal > 0) { 374 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 375 | sizeToDeal, numToDeal, 376 | dead, INNER_LOOP_ANY_HILO); 377 | } else { 378 | INNER_LOOP_ANY_HILO; 379 | } 380 | } else if (game == game_7studnsq) { 381 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 382 | sizeToDeal, numToDeal, 383 | dead, INNER_LOOP_7STUDNSQ); 384 | } else if (game == game_razz) { 385 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 386 | sizeToDeal, numToDeal, 387 | dead, INNER_LOOP_RAZZ); 388 | } else if (game == game_lowball27) { 389 | DECK_ENUMERATE_COMBINATIONS_D(StdDeck, cardsDealt, 390 | sizeToDeal, numToDeal, 391 | dead, INNER_LOOP_LOWBALL27); 392 | } else { 393 | return 1; 394 | } 395 | 396 | result->game = game; 397 | result->nplayers = sizeToDeal - 1; 398 | result->sampleType = ENUM_EXHAUSTIVE; 399 | return 0; 400 | } 401 | 402 | static int 403 | pyenumSample(enum_game_t game, StdDeck_CardMask pockets[], 404 | int numToDeal[], 405 | StdDeck_CardMask board, StdDeck_CardMask dead, 406 | int sizeToDeal, int iterations, enum_result_t *result) { 407 | int i; 408 | enumResultClear(result); 409 | StdDeck_CardMask cardsDealt[ENUM_MAXPLAYERS + 1]; 410 | memset(cardsDealt, 0, sizeof(StdDeck_CardMask) * (ENUM_MAXPLAYERS + 1)); 411 | if (sizeToDeal - 1 > ENUM_MAXPLAYERS) 412 | return 1; 413 | 414 | /* 415 | * Cards in pockets or in the board must not be dealt 416 | */ 417 | StdDeck_CardMask_OR(dead, dead, board); 418 | for(i = 0; i < sizeToDeal - 1; i++) { 419 | StdDeck_CardMask_OR(dead, dead, pockets[i]); 420 | } 421 | 422 | if (game == game_holdem) { 423 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 424 | sizeToDeal, numToDeal, 425 | dead, iterations, INNER_LOOP_ANY_HIGH); 426 | } else if (game == game_holdem8) { 427 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 428 | sizeToDeal, numToDeal, 429 | dead, iterations, INNER_LOOP_ANY_HILO); 430 | } else if (game == game_omaha) { 431 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 432 | sizeToDeal, numToDeal, 433 | dead, iterations, INNER_LOOP_OMAHA); 434 | } else if (game == game_omaha8) { 435 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 436 | sizeToDeal, numToDeal, 437 | dead, iterations, INNER_LOOP_OMAHA8); 438 | } else if (game == game_7stud) { 439 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 440 | sizeToDeal, numToDeal, 441 | dead, iterations, INNER_LOOP_ANY_HIGH); 442 | } else if (game == game_7stud8) { 443 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 444 | sizeToDeal, numToDeal, 445 | dead, iterations, INNER_LOOP_ANY_HILO); 446 | } else if (game == game_7studnsq) { 447 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 448 | sizeToDeal, numToDeal, 449 | dead, iterations, INNER_LOOP_7STUDNSQ); 450 | } else if (game == game_razz) { 451 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 452 | sizeToDeal, numToDeal, 453 | dead, iterations, INNER_LOOP_RAZZ); 454 | } else if (game == game_lowball27) { 455 | DECK_MONTECARLO_PERMUTATIONS_D(StdDeck, cardsDealt, 456 | sizeToDeal, numToDeal, 457 | dead, iterations, INNER_LOOP_LOWBALL27); 458 | } else { 459 | return 1; 460 | } 461 | 462 | result->game = game; 463 | result->nplayers = sizeToDeal - 1; 464 | result->sampleType = ENUM_SAMPLE; 465 | return 0; 466 | } 467 | 468 | #define NOCARD 255 469 | 470 | static int PyList2CardMask(PyObject* object, CardMask* cardsp) 471 | { 472 | CardMask cards; 473 | int cards_size = 0; 474 | int valid_cards_size = 0; 475 | 476 | if(!PyList_Check(object)) { 477 | PyErr_SetString(PyExc_TypeError, "expected a list of cards"); 478 | return -1; 479 | } 480 | 481 | valid_cards_size = cards_size = PyList_Size(object); 482 | CardMask_RESET(cards); 483 | 484 | int card; 485 | int i; 486 | for(i = 0; i < cards_size; i++) { 487 | card = -1; 488 | PyObject* pycard = PyList_GetItem(object, i); 489 | if(PyErr_Occurred()) 490 | return -1; 491 | #ifdef IS_PY3K 492 | if(PyUnicode_Check(pycard)) { 493 | PyObject * temp_bytes = PyUnicode_AsEncodedString(pycard, "ASCII", "strict"); 494 | if (temp_bytes == NULL) return -2; 495 | char* card_string = PyBytes_AS_STRING(temp_bytes); 496 | card_string = strdup(card_string); 497 | Py_DECREF(temp_bytes); 498 | #else 499 | if(PyString_Check(pycard)) { 500 | char* card_string = PyString_AsString(pycard); 501 | #endif 502 | if(!strcmp(card_string, "__")) { 503 | card = 255; 504 | } else { 505 | if(Deck_stringToCard(card_string, &card) == 0) { 506 | PyErr_Format(PyExc_RuntimeError, "card %s is not a valid card name", card_string); 507 | return -1; 508 | } 509 | } 510 | } else if(PyInteger_Check(pycard)) { 511 | card = PyInteger_AsLong(pycard); 512 | if(card != NOCARD && (card < 0 || card > StdDeck_N_CARDS)) { 513 | PyErr_Format(PyExc_TypeError, "card value (%d) must be in the range [0-%d]", card, StdDeck_N_CARDS); 514 | return -1; 515 | } 516 | } else { 517 | PyErr_SetString(PyExc_TypeError, "card must be a string or an int"); 518 | return -1; 519 | } 520 | 521 | if(card == NOCARD) 522 | valid_cards_size--; 523 | else 524 | CardMask_SET(cards, card); 525 | } 526 | 527 | *cardsp = cards; 528 | 529 | return valid_cards_size; 530 | } 531 | 532 | #if 0 533 | static PyObject* CardMask2PyList(CardMask* cardmask) 534 | { 535 | PyObject* result = 0; 536 | int cardmask_size = StdDeck_numCards(cardmask); 537 | int cards[64]; 538 | int i; 539 | 540 | if((i = CurDeck.maskToCards(cardmask, cards)) != cardmask_size) { 541 | PyErr_Format(PyExc_RuntimeError, "CardMask2PyList: maskToCards returns %d cards, expected %d\n", i, cardmask_size); 542 | return 0; 543 | } 544 | 545 | result = PyList_New(0); 546 | for(i = 0; i < cardmask_size; i++) { 547 | PyObject* pycard = Py_BuildValue("i", cards[i]); 548 | int status = PyList_Append(result, pycard); 549 | Py_DECREF(pycard); 550 | if(status < 0) return 0; 551 | } 552 | 553 | return result; 554 | } 555 | #endif 556 | 557 | static char doc_poker_evaln[] = 558 | "EvalN"; 559 | 560 | static PyObject* 561 | poker_evaln(PyObject* self, PyObject *args) 562 | { 563 | CardMask cards; 564 | PyObject* pycards; 565 | HandVal handval; 566 | 567 | if (!PyArg_ParseTuple(args, "O", &pycards)) 568 | return NULL; 569 | 570 | if(PyList2CardMask(pycards, &cards) < 0) 571 | return NULL; 572 | 573 | handval = Hand_EVAL_N(cards, PyList_Size(pycards)); 574 | 575 | return Py_BuildValue("i", handval); 576 | } 577 | 578 | static char doc_string2card[] = 579 | "return the numerical representation of a card"; 580 | 581 | static PyObject* 582 | string2card(PyObject* self, PyObject *args) 583 | { 584 | char* card_string = 0; 585 | 586 | if (!PyArg_ParseTuple(args, "s", &card_string)) 587 | return NULL; 588 | 589 | { 590 | int card = 0; 591 | 592 | if(!strcmp(card_string, "__")) { 593 | card = 255; 594 | } else { 595 | if(Deck_stringToCard(card_string, &card) == 0) { 596 | PyErr_Format(PyExc_RuntimeError, "card %s is not a valid card name", card_string); 597 | return NULL; 598 | } 599 | } 600 | 601 | return Py_BuildValue("b", (unsigned char)card); 602 | } 603 | } 604 | 605 | static char doc_card2string[] = 606 | "return the string representation of a numerical card"; 607 | 608 | static PyObject* 609 | card2string(PyObject* self, PyObject *args) 610 | { 611 | int card = 0; 612 | 613 | if (!PyArg_ParseTuple(args, "i", &card)) 614 | return NULL; 615 | 616 | if(card == 255) { 617 | return Py_BuildValue("s", "__"); 618 | } else { 619 | /* 620 | * Avoid using GenericDeck_cardString as long as it insists 621 | * on using the "static thread" hack (see lib/deck.c). 622 | */ 623 | char tmp[16]; 624 | StdDeck.cardToString(card, tmp); 625 | return Py_BuildValue("s", tmp); 626 | } 627 | } 628 | 629 | /* 630 | * Find the card with highest suit matching rank in hand 631 | * and remove it from hand. The removed card is returned. 632 | */ 633 | int findanddelete(CardMask* hand, int rank) 634 | { 635 | int suit; 636 | for(suit = StdDeck_Suit_LAST; suit >= StdDeck_Suit_FIRST; suit--) { 637 | int card = StdDeck_MAKE_CARD(rank, suit); 638 | if(CardMask_CARD_IS_SET(*hand, card)) { 639 | CardMask_UNSET(*hand, card); 640 | return card; 641 | } 642 | } 643 | return -1; 644 | } 645 | 646 | #define LOWRANK2RANK(c) ((c) == StdDeck_Rank_2 ? StdDeck_Rank_ACE : (c-1)) 647 | 648 | static PyObject* 649 | CardMask2SortedPyList(CardMask hand, int low) 650 | { 651 | int i; 652 | HandVal handval; 653 | PyObject* result = PyList_New(0); 654 | 655 | if(StdDeck_CardMask_IS_EMPTY(hand)) { 656 | PyObject* pyvalue = Py_BuildValue("s", "Nothing"); 657 | PyList_Append(result, pyvalue); 658 | Py_DECREF(pyvalue); 659 | return result; 660 | } 661 | 662 | if(low) { 663 | handval = Hand_EVAL_LOW8(hand, 5); 664 | } else { 665 | handval = Hand_EVAL_N(hand, 5); 666 | } 667 | 668 | int htype = HandVal_HANDTYPE(handval); 669 | { 670 | PyObject* pyvalue = Py_BuildValue("s", StdRules_handTypeNames[htype]); 671 | PyList_Append(result, pyvalue); 672 | Py_DECREF(pyvalue); 673 | } 674 | 675 | if(!low || htype != LowHandVal_NOTHING) { 676 | if (StdRules_nSigCards[htype] >= 1) { 677 | int rank = HandVal_TOP_CARD(handval); 678 | if(low) rank = LOWRANK2RANK(rank); 679 | 680 | if(htype == HandType_STRAIGHT || htype == HandType_STFLUSH) { 681 | for(i = rank; rank - i < 5; i--) { 682 | int rank_modulo = i < 0 ? StdDeck_Rank_ACE : i; 683 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank_modulo)); 684 | PyList_Append(result, pyvalue); 685 | Py_DECREF(pyvalue); 686 | } 687 | } else { 688 | int count; 689 | switch(htype) { 690 | case HandType_ONEPAIR: 691 | case HandType_TWOPAIR: 692 | count = 2; 693 | break; 694 | case HandType_TRIPS: 695 | case HandType_FULLHOUSE: 696 | count = 3; 697 | break; 698 | case HandType_QUADS: 699 | count = 4; 700 | break; 701 | default: 702 | count = 1; 703 | break; 704 | } 705 | for(i = 0; i < count; i++) { 706 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank)); 707 | PyList_Append(result, pyvalue); 708 | Py_DECREF(pyvalue); 709 | } 710 | } 711 | } 712 | if (StdRules_nSigCards[htype] >= 2) { 713 | int rank = HandVal_SECOND_CARD(handval); 714 | int count = 1; 715 | if(low) rank = LOWRANK2RANK(rank); 716 | if(htype == HandType_TWOPAIR || 717 | htype == HandType_FULLHOUSE) 718 | count = 2; 719 | 720 | for(i = 0; i < count; i++) { 721 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank)); 722 | PyList_Append(result, pyvalue); 723 | Py_DECREF(pyvalue); 724 | } 725 | } 726 | 727 | if (StdRules_nSigCards[htype] >= 3) { 728 | int rank = HandVal_THIRD_CARD(handval); 729 | if(low) rank = LOWRANK2RANK(rank); 730 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank)); 731 | PyList_Append(result, pyvalue); 732 | Py_DECREF(pyvalue); 733 | } 734 | 735 | if (StdRules_nSigCards[htype] >= 4) { 736 | int rank = HandVal_FOURTH_CARD(handval); 737 | if(low) rank = LOWRANK2RANK(rank); 738 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank)); 739 | PyList_Append(result, pyvalue); 740 | Py_DECREF(pyvalue); 741 | } 742 | 743 | if (StdRules_nSigCards[htype] >= 5) { 744 | int rank = HandVal_FIFTH_CARD(handval); 745 | if(low) rank = LOWRANK2RANK(rank); 746 | PyObject* pyvalue = Py_BuildValue("i", findanddelete(&hand, rank)); 747 | PyList_Append(result, pyvalue); 748 | Py_DECREF(pyvalue); 749 | } 750 | 751 | } 752 | 753 | /* 754 | * Append remaining cards, highest first 755 | */ 756 | for(i = Deck_N_CARDS - 1; i >= 0; i--) { 757 | if (StdDeck_CardMask_CARD_IS_SET(hand, i)) { 758 | PyObject* pyvalue = Py_BuildValue("i", i); 759 | PyList_Append(result, pyvalue); 760 | Py_DECREF(pyvalue); 761 | } 762 | } 763 | 764 | return result; 765 | } 766 | 767 | /* Evaluate an omaha hand for both high and low. Return nonzero on error. 768 | If hival is NULL, skips high evaluation; if loval is NULL, skips 769 | low evaluation. Low eval could be sped up with 256x256 rank table. */ 770 | 771 | static int 772 | OmahaHiLow8_Best(StdDeck_CardMask hole, StdDeck_CardMask board, 773 | HandVal *hival, LowHandVal *loval, 774 | StdDeck_CardMask *hicards, StdDeck_CardMask *locards) { 775 | StdDeck_CardMask allcards; 776 | LowHandVal allval; 777 | HandVal curhi, besthi; 778 | LowHandVal curlo, bestlo; 779 | StdDeck_CardMask hole1[OMAHA_MAXHOLE]; 780 | StdDeck_CardMask board1[OMAHA_MAXBOARD]; 781 | StdDeck_CardMask n1, n2, n3, n4, n5; 782 | int nhole, nboard; 783 | int eligible = 0; 784 | int i, h1, h2, b1, b2, b3; 785 | 786 | /* pluck out individual cards from hole and board masks, save in arrays */ 787 | nhole = nboard = 0; 788 | for (i=0; i= OMAHA_MAXHOLE) 791 | return 1; /* too many hole cards */ 792 | StdDeck_CardMask_RESET(hole1[nhole]); 793 | StdDeck_CardMask_SET(hole1[nhole], i); 794 | nhole++; 795 | } 796 | if (StdDeck_CardMask_CARD_IS_SET(board, i)) { 797 | if (StdDeck_CardMask_CARD_IS_SET(hole, i)) /* same card in hole and board */ 798 | return 2; 799 | if (nboard >= OMAHA_MAXBOARD) 800 | return 3; /* too many board cards */ 801 | StdDeck_CardMask_RESET(board1[nboard]); 802 | StdDeck_CardMask_SET(board1[nboard], i); 803 | nboard++; 804 | } 805 | } 806 | 807 | if (nhole < OMAHA_MINHOLE || nhole > OMAHA_MAXHOLE) 808 | return 4; /* wrong # of hole cards */ 809 | if (nboard < OMAHA_MINBOARD || nboard > OMAHA_MAXBOARD) 810 | return 5; /* wrong # of board cards */ 811 | 812 | /* quick test in case no low is possible with all 9 cards */ 813 | if (loval != NULL) { 814 | StdDeck_CardMask_OR(allcards, hole, board); 815 | allval = StdDeck_Lowball8_EVAL(allcards, nhole + nboard); 816 | eligible = (allval != LowHandVal_NOTHING); 817 | } 818 | 819 | /* loop over all combinations of hole with board (60 for 4 hole cards 820 | and 5 board cards). */ 821 | besthi = HandVal_NOTHING; 822 | bestlo = LowHandVal_NOTHING; 823 | /* {h1,h2} loop over all hole card combinations */ 824 | for (h1=0; h1 besthi || besthi == HandVal_NOTHING) { 839 | besthi = curhi; 840 | *hicards = n5; 841 | } 842 | } 843 | if (loval != NULL && eligible) { 844 | curlo = StdDeck_Lowball8_EVAL(n5, 5); 845 | if (curlo < bestlo || bestlo == LowHandVal_NOTHING) { 846 | bestlo = curlo; 847 | *locards = n5; 848 | } 849 | } 850 | } 851 | } 852 | } 853 | } 854 | } 855 | if (hival != NULL) *hival = besthi; 856 | if (loval != NULL) *loval = bestlo; 857 | return 0; 858 | } 859 | 860 | static char doc_eval_hand[] = 861 | "return the evaluation of the hand, either low or hi. Result is a list, first element hand value, second element the best 5 card hand as a list of card values."; 862 | 863 | static PyObject* 864 | eval_hand(PyObject* self, PyObject *args) 865 | { 866 | PyObject* result = 0; 867 | char* hilow_string = 0; 868 | PyObject* pyhand = 0; 869 | PyObject* pyboard = 0; 870 | int low = 0; 871 | CardMask hand; 872 | CardMask board; 873 | int board_size = 0; 874 | CardMask best; 875 | HandVal best_handval; 876 | 877 | StdDeck_CardMask_RESET(best); 878 | 879 | if (!PyArg_ParseTuple(args, "sOO", &hilow_string, &pyhand, &pyboard)) 880 | return NULL; 881 | 882 | if(!strcmp(hilow_string, "low")) 883 | low = 1; 884 | 885 | if(PyList2CardMask(pyhand, &hand) < 0) 886 | return NULL; 887 | 888 | board_size = PyList2CardMask(pyboard, &board); 889 | 890 | if(board_size > 0) { 891 | CardMask hicards; 892 | CardMask locards; 893 | HandVal hival = 0; 894 | HandVal loval = 0; 895 | StdDeck_CardMask_RESET(hicards); 896 | StdDeck_CardMask_RESET(locards); 897 | OmahaHiLow8_Best(hand, board, &hival, &loval, &hicards, &locards); 898 | if(low) { 899 | best_handval = loval; 900 | if(best_handval != LowHandVal_NOTHING) 901 | best = locards; 902 | } else { 903 | best = hicards; 904 | best_handval = hival; 905 | } 906 | } else { 907 | CardMask cards; 908 | CardMask dead; 909 | 910 | StdDeck_CardMask_RESET(best); 911 | 912 | StdDeck_CardMask_RESET(dead); 913 | StdDeck_CardMask_OR(dead, dead, hand); 914 | StdDeck_CardMask_NOT(dead, dead); 915 | 916 | if(low) { 917 | best_handval = LowHandVal_NOTHING; 918 | } else { 919 | best_handval = HandVal_NOTHING; 920 | } 921 | 922 | ENUMERATE_N_CARDS_D(cards, 5, dead, 923 | { 924 | HandVal handval; 925 | 926 | if(low) { 927 | handval = Hand_EVAL_LOW8(cards, 5); 928 | } else { 929 | handval = Hand_EVAL_N(cards, 5); 930 | } 931 | 932 | if(low ? (handval < best_handval) : (handval > best_handval)) { 933 | best = cards; 934 | best_handval = handval; 935 | } 936 | } 937 | ); 938 | } 939 | 940 | if(StdDeck_CardMask_IS_EMPTY(best)) { 941 | best_handval = low ? 0x0FFFFFFF : 0; 942 | } 943 | 944 | result = PyList_New(0); 945 | { 946 | PyObject* pyvalue = Py_BuildValue("i", best_handval); 947 | PyList_Append(result, pyvalue); 948 | Py_DECREF(pyvalue); 949 | } 950 | { 951 | PyObject* pyvalue = CardMask2SortedPyList(best, low); 952 | PyList_Append(result, pyvalue); 953 | Py_DECREF(pyvalue); 954 | } 955 | return result; 956 | } 957 | 958 | static char doc_poker_eval[] = 959 | "eval a poker game state"; 960 | 961 | static PyObject* 962 | poker_eval(PyObject* self, PyObject *args, PyObject *keywds) 963 | { 964 | int i; 965 | int pockets_size; 966 | int fill_pockets = 0; 967 | int iterations = 0; 968 | PyObject* pypockets = 0; 969 | PyObject* pyboard = 0; 970 | char* game = 0; 971 | PyObject* pydead = 0; 972 | enum_gameparams_t* params = 0; 973 | 974 | StdDeck_CardMask pockets[ENUM_MAXPLAYERS]; 975 | int numToDeal[ENUM_MAXPLAYERS]; 976 | CardMask dead_cards; 977 | CardMask board_cards; 978 | 979 | PyObject* result = NULL; 980 | 981 | static char *kwlist[] = {"game", "pockets", "board", "dead", "fill_pockets", "iterations", NULL}; 982 | 983 | if (!PyArg_ParseTupleAndKeywords(args, keywds, "sOO|Oii", kwlist, 984 | &game, &pypockets, &pyboard, &pydead, &fill_pockets, &iterations)) 985 | return NULL; 986 | 987 | if(!strcmp(game, "holdem")) { 988 | params = enumGameParams(game_holdem); 989 | } else if(!strcmp(game, "holdem8")) { 990 | params = enumGameParams(game_holdem8); 991 | } else if(!strcmp(game, "omaha")) { 992 | params = enumGameParams(game_omaha); 993 | } else if(!strcmp(game, "omaha8")) { 994 | params = enumGameParams(game_omaha8); 995 | } else if(!strcmp(game, "7stud")) { 996 | params = enumGameParams(game_7stud); 997 | } else if(!strcmp(game, "7stud8")) { 998 | params = enumGameParams(game_7stud8); 999 | } else if(!strcmp(game, "7studnsq")) { 1000 | params = enumGameParams(game_7studnsq); 1001 | } else if(!strcmp(game, "razz")) { 1002 | params = enumGameParams(game_razz); 1003 | } else if(!strcmp(game, "5draw")) { 1004 | params = enumGameParams(game_5draw); 1005 | } else if(!strcmp(game, "5draw8")) { 1006 | params = enumGameParams(game_5draw8); 1007 | } else if(!strcmp(game, "5drawnsq")) { 1008 | params = enumGameParams(game_5drawnsq); 1009 | } else if(!strcmp(game, "lowball")) { 1010 | params = enumGameParams(game_lowball); 1011 | } else if(!strcmp(game, "lowball27")) { 1012 | params = enumGameParams(game_lowball27); 1013 | } 1014 | if(params == 0) { 1015 | PyErr_Format(PyExc_RuntimeError, "game %s is not a valid value (holdem, holdem8, omaha, omaha8, 7stud, 7stud8, 7studnsq, razz, 5draw, 5draw8, 5drawnsq, lowball, lowball27)", game); 1016 | } 1017 | 1018 | if(!PyList_Check(pypockets)) { 1019 | PyErr_SetString(PyExc_TypeError, "pockets must be list"); 1020 | goto err; 1021 | } 1022 | 1023 | pockets_size = PyList_Size(pypockets); 1024 | 1025 | { 1026 | for(i = 0; i < pockets_size; i++) { 1027 | int count; 1028 | CardMask_RESET(pockets[i]); 1029 | PyObject* pypocket = PyList_GetItem(pypockets, i); 1030 | if(PyErr_Occurred()) 1031 | goto err; 1032 | 1033 | count = PyList2CardMask(pypocket, &pockets[i]); 1034 | if(count < 0) 1035 | goto err; 1036 | if(count < PyList_Size(pypocket)) 1037 | numToDeal[i + 1] = PyList_Size(pypocket) - count; 1038 | else 1039 | numToDeal[i + 1] = 0; 1040 | } 1041 | } 1042 | 1043 | { 1044 | int count; 1045 | count = PyList2CardMask(pyboard, &board_cards); 1046 | if(count < 0) 1047 | goto err; 1048 | if(count < PyList_Size(pyboard)) 1049 | numToDeal[0] = PyList_Size(pyboard) - count; 1050 | else 1051 | numToDeal[0] = 0; 1052 | } 1053 | 1054 | if(pydead) { 1055 | if(PyList2CardMask(pydead, &dead_cards) < 0) 1056 | goto err; 1057 | } else { 1058 | CardMask_RESET(dead_cards); 1059 | } 1060 | 1061 | { 1062 | enum_result_t cresult; 1063 | int err; 1064 | memset(&cresult, '\0', sizeof(enum_result_t)); 1065 | 1066 | if(iterations > 0) { 1067 | err = pyenumSample(params->game, pockets, numToDeal, board_cards, dead_cards, pockets_size + 1, iterations, &cresult); 1068 | } else { 1069 | err = pyenumExhaustive(params->game, pockets, numToDeal, board_cards, dead_cards, pockets_size + 1, &cresult); 1070 | } 1071 | if(err != 0) { 1072 | PyErr_Format(PyExc_RuntimeError, "poker-eval: pyenum returned error code %d", err); 1073 | return 0; 1074 | } 1075 | 1076 | result = PyList_New(0); 1077 | 1078 | PyObject* tmp; 1079 | tmp = Py_BuildValue("(iii)", cresult.nsamples, params->haslopot, params->hashipot); 1080 | PyList_Append(result, tmp); 1081 | Py_DECREF(tmp); 1082 | for(i = 0; i < pockets_size; i++) { 1083 | tmp = Py_BuildValue("(iiiiiiid)", 1084 | cresult.nscoop[i], 1085 | cresult.nwinhi[i], 1086 | cresult.nlosehi[i], 1087 | cresult.ntiehi[i], 1088 | cresult.nwinlo[i], 1089 | cresult.nloselo[i], 1090 | cresult.ntielo[i], 1091 | cresult.ev[i] / cresult.nsamples); 1092 | PyList_Append(result, tmp); 1093 | Py_DECREF(tmp); 1094 | } 1095 | } 1096 | 1097 | err: 1098 | return result; 1099 | } 1100 | 1101 | static PyMethodDef base_methods[] = { 1102 | { "eval_hand", (PyCFunction)eval_hand, METH_VARARGS | METH_KEYWORDS, doc_eval_hand }, 1103 | { "poker_eval", (PyCFunction)poker_eval, METH_VARARGS | METH_KEYWORDS, doc_poker_eval }, 1104 | { "evaln", (PyCFunction)poker_evaln, METH_VARARGS, doc_poker_evaln }, 1105 | { "string2card", (PyCFunction)string2card, METH_VARARGS, doc_string2card }, 1106 | { "card2string", (PyCFunction)card2string, METH_VARARGS, doc_card2string }, 1107 | {NULL, NULL, 0, NULL} 1108 | }; 1109 | 1110 | #ifdef __cplusplus 1111 | extern "C" { 1112 | #endif 1113 | #ifdef IS_PY3K 1114 | static int base_traverse(PyObject *m, visitproc visit, void *arg){ 1115 | Py_VISIT(GETSTATE(m)->error); 1116 | return 0; 1117 | } 1118 | static int base_clear(PyObject *m){ 1119 | Py_CLEAR(GETSTATE(m)->error); 1120 | return 0; 1121 | } 1122 | static struct PyModuleDef moduledef = { 1123 | PyModuleDef_HEAD_INIT, 1124 | "_pokereval_", 1125 | NULL, 1126 | sizeof(struct module_state), 1127 | base_methods, 1128 | NULL, 1129 | base_traverse, 1130 | base_clear, 1131 | NULL 1132 | }; 1133 | PyObject * VERSION_NAME(PyInit__pokereval_)(void) { 1134 | PyObject * module = PyModule_Create( &moduledef); 1135 | if(module == NULL) return NULL; 1136 | struct module_state *st = GETSTATE(module); 1137 | st->error = PyErr_NewException("_pokereval_.Error", NULL, NULL); 1138 | if(st->error == NULL){ 1139 | Py_DECREF(module); 1140 | return NULL; 1141 | } 1142 | return module; 1143 | } 1144 | #else 1145 | DL_EXPORT(void) 1146 | VERSION_NAME(init_pokereval_)(void) 1147 | { 1148 | Py_InitModule("_pokereval_" PYTHON_VERSION , base_methods); 1149 | } 1150 | #endif 1151 | #ifdef __cplusplus 1152 | } 1153 | #endif 1154 | --------------------------------------------------------------------------------