Beggar my Neighbour simulator in Python
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
beggarmypython
.gitignore
README.md
test.py
test_issue_1.py

README.md

Does an infinite game of Beggar-My-Neighbour exist? This question has definitely not plagued scientists for millennia. However, in the event that you think you have found a very long game of Beggar My Neighbour, you might wish to run it through a Beggar My Neighbour simulator written in Python. You can see a full list of record holders here: http://www.richardpmann.com/beggar-my-neighbour-records.html

Usage:

python test.py

Output:

Paulhus 1999:
Starting hands: ------------KAQ----J------/-JQQK---K----JK--QA-A-JA--
There were 4791 turns
There were 670 tricks

Kleber 1999:
Starting hands: ---JQ---K-A----A-J-K---QK-/-J-----------AJQA----K---Q
There were 5790 turns
There were 805 tricks

Collins 2006:
Starting hands: A-QK------Q----KA-----J---/-JAK----A--Q----J---QJ--K-
There were 6913 turns
There were 960 tricks

Mann and Wu 2007:
Starting hands: K-KK----K-A-----JAA--Q--J-/---Q---Q-J-----J------AQ--
There were 7157 turns
There were 1007 tricks

Nessler 2012:
Starting hands: ----Q------A--K--A-A--QJK-/-Q--J--J---QK---K----JA---
There were 7207 turns
There were 1015 tricks

Anderson 2013:
Starting hands: --A-Q--J--J---Q--AJ-K---K-/-J-------Q------A--A--QKK-
There were 7225 turns
There were 1016 tricks

Rucklidge 2014:
Starting hands: -J------Q------AAA-----QQ-/K----JA-----------KQ-K-JJK
There were 7959 turns
There were 1122 tricks