{ "info": { "author": "Al Sweigart", "author_email": "al@inventwithpython.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.1", "Programming Language :: Python :: 3.2", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "Zombie Dice Simulator\n=====================\n\nA simulator for the dice game Zombie Dice that can run bot AI players.\n\nZombie Dice is a quick, fun dice game from Steve Jackson Games. The players are zombies trying to eat as many human brains without getting \u201cshotgunned\u201d by the humans. On their turn, a player will randomly select three dice from a cup of thirteen dice and roll them. The die faces are brains, footsteps, and shotguns. You get one point per brain, but if you roll a cumulative three shotguns, you\u2019ve been shotgunned and get zero points for your turn. You can then decide to re-roll or pass your turn to the next player. If a die came up as \u201cfootsteps\u201d, it\u2019s used again if the player decides to re-roll. (The player always uses three dice for each roll.) Zombie Dice has a \u201cpush your luck\u201d game mechanic: the more times you choose to re-roll the dice, the more brains you can get but the more likely you\u2019ll collect three shotguns. The game continues until a player reaches 13 brains, and then the rest of the players get one more turn. The dice are colored green (brains are more likely), red (shotguns are more likely), and yellow (brains and shotguns are even).\n\nMore complete rules for Zombie Dice can be found here:\n\n* `PDF of the rules in English `_\n* `Animated Flash demo of how to play `_\n* `Instructables article with the rules `_\n* `YouTube video of someone explaining the rules `_\n\nThis simulator is useful for beginner/intermediate programming lessons or contests. The API for making bots is simple, and it features a web UI for projecting a nifty display of the tournament as it runs.\n\n.. image:: screenshot.jpg\n\nQuickstart\n----------\n\nTo install, run the usual ``pip install zombiedice`` (on Windows) or ``pip3 install zombiedice`` (on macOS/Linux).\n\nYou can view a demo with some pre-made bots by running ``python -m zombiedice`` (on Windows) or ``pip3 install zombiedice`` (on macOS/Linux).\n\nAlternatively, you can run ``import zombiedice; zombiedice.demo()``\n\nFirst, you need to create your own zombie. This is done by creating a class that implements a ``turn()`` method (called when it is your zombie's turn). The ``turn()`` method either calls the ``zombiedice.roll()`` function if you want to roll again, or returns to signal the end of their turn. The ``turn()`` method accepts one argument of the game state (documented later on this page). This class should also have a ``'name'`` attribute that contains a string of the player name. (This is so that the same class can be used for multiple players in a game.)\n\nThe ``zombiedice.roll()`` function returns a list of dictionaries. The dictionaries represent the dice roll results; it has a ``'color'`` and ``'icon'`` keys, which have possible values of ``'green'``, ``'yellow'``, ``'red'`` and ``'shotgun'``, ``'brains'``, and ``'footsteps'`` respectively. The list will contain three of these dictionaries for the three dice roll results. If the player has reached three shotguns or more, this list will be empty.\n\nHere's an example of a zombie that keeps rolling until they've reached two shotguns, then stops. More example zombies can be found in *examples.py* in the *zombiedice* package::\n\n\n class StopsAt2ShotgunsZombie(object):\n \"\"\"This bot keeps rolling until it reaches 2 shotguns.\"\"\"\n def __init__(self, name):\n self.name = name\n\n def turn(self, gameState):\n shotgunsRolled = 0\n while shotgunsRolled < 2:\n results = roll()\n\n if results == []:\n # Zombie has reached 3 or more shotguns.\n return\n\n for i in results:\n # Count shotguns in results.\n if i[ICON] == SHOTGUN:\n shotguns += 1\n\nNext, you need to run a tournament. Create a file that calls either ``zombiedice.runWebGui()`` (for the nice web GUI) or ``zombiedice.runTournament()`` (for the plain command line interface). A typical file will look like *demo.py* in the `repo `_::\n\n import zombiedice\n\n zombies = (\n zombiedice.examples.RandomCoinFlipZombie(name='Random'),\n zombiedice.examples.MonteCarloZombie(name='Monte Carlo', riskiness=40, numExperiments=20),\n zombiedice.examples.MinNumShotgunsThenStopsZombie(name='Min 2 Shotguns', minShotguns=2)\n # Add any other zombie players here.\n )\n\n # Uncomment one of the following lines to run in CLI or Web GUI mode:\n #zombiedice.runTournament(zombies=zombies, numGames=1000)\n zombiedice.runWebGui(zombies=zombies, numGames=1000)\n\nExample Zombies\n---------------\n\nThere are a few example zombies included with the module:\n\n* ``zombiedice.examples.RandomCoinFlipZombie(name)`` - Randomly decides 50/50 whether to continue rolling or quit.\n* ``zombiedice.examples.MinNumShotgunsThenStopsZombie(name, minShotguns)`` - Keeps rolling until it rolls the minimum number of shotguns specified.\n* ``zombiedice.examples.MinNumShotgunsThenStopsOneMoreZombie(name, minShotguns)`` - Like MinNumShotgunsThenStopsZombie, except it will roll one more time.\n* ``zombiedice.examples.HumanPlayerZombie(name)`` - Calls input() to let a human player play against the bots.\n* ``zombiedice.examples.RollsUntilInTheLeadZombie(name)`` - Keeps rolling until they are in first place.\n* ``zombiedice.examples.MonteCarloZombie(name, riskiness, numExperiments)`` - Does a number of monte carlo simulation (``numExperiments``) to determine what will happen if they roll again. As long as the percentage of simulations resulting in three shotguns is less than ``riskiness``, it will roll again.\n\n\nTODO\n----\n\nMore details about how this module works to come.", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/asweigart/zombiedice", "keywords": "zombie dice game ai simulator bots", "license": "BSD", "maintainer": "", "maintainer_email": "", "name": "zombiedice", "package_url": "https://pypi.org/project/zombiedice/", "platform": "", "project_url": "https://pypi.org/project/zombiedice/", "project_urls": { "Homepage": "https://github.com/asweigart/zombiedice" }, "release_url": "https://pypi.org/project/zombiedice/0.1.5/", "requires_dist": null, "requires_python": "", "summary": "A simulator for the dice game Zombie Dice that can run bot AI players.", "version": "0.1.5" }, "last_serial": 4808128, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "f2d365789eaf999dfc588ec984ce7b03", "sha256": "777c4b76cef4e56b02295bbd64e267983eae5e0c44bdea9221bd9866bca7adff" }, "downloads": -1, "filename": "zombiedice-0.1.0.tar.gz", "has_sig": false, "md5_digest": "f2d365789eaf999dfc588ec984ce7b03", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191506, "upload_time": "2018-10-16T20:33:28", "url": "https://files.pythonhosted.org/packages/1d/9a/53fe329bc294c37c85d80f4d90ba1d9de725164d2734db44eaf91b77ab0b/zombiedice-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "68a101be0614080ba1214c275d687554", "sha256": "26591d612d6f5b805659fb229b76089fb6f621e44874541f6424dd771cbdfe36" }, "downloads": -1, "filename": "zombiedice-0.1.1.tar.gz", "has_sig": false, "md5_digest": "68a101be0614080ba1214c275d687554", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 191491, "upload_time": "2018-10-16T20:38:38", "url": "https://files.pythonhosted.org/packages/91/5c/a1990dbc416d0e692bda914741ec88fc258c56c8c4940fed812239141b52/zombiedice-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "8b09e7a50b0b9d380c6f31adeef149b9", "sha256": "7a0f3dd210c038aa0fe4dc72f8eef14dc06906a3c3306a61a89eceba3ec2a011" }, "downloads": -1, "filename": "zombiedice-0.1.2.tar.gz", "has_sig": false, "md5_digest": "8b09e7a50b0b9d380c6f31adeef149b9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 192239, "upload_time": "2018-10-17T03:48:07", "url": "https://files.pythonhosted.org/packages/4b/58/6dcdcaf37ec60e9f1edb379497ea16338852dff9eb6b37e72c852fc6aaa3/zombiedice-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d46aa4b862ea18aeacfdae079ea0d8f6", "sha256": "3b458f08b48b2705f472a2015ac10e6fd1f69698d6e67de02744bc48dfca6895" }, "downloads": -1, "filename": "zombiedice-0.1.3.tar.gz", "has_sig": false, "md5_digest": "d46aa4b862ea18aeacfdae079ea0d8f6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 135397, "upload_time": "2018-10-18T00:26:48", "url": "https://files.pythonhosted.org/packages/cf/5b/48c455990b203012788f389850bd7d4812d0c0e8e95fd9f6d423e54e75cc/zombiedice-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "591c4824fd5a323bfe7948495e420816", "sha256": "255587ad63e6d16a470e7e7b9a9649097b7ac46efa7895b6a0173ef001132166" }, "downloads": -1, "filename": "zombiedice-0.1.4.tar.gz", "has_sig": false, "md5_digest": "591c4824fd5a323bfe7948495e420816", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 106100, "upload_time": "2019-02-11T19:59:24", "url": "https://files.pythonhosted.org/packages/73/a3/28768bbab8867fb6d4cf52722cc0ea641886e115ad1cad5805f65c73162a/zombiedice-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "1d4f1a1afb3c1c3ac3b2cadd54f669e5", "sha256": "f3d8d72c40fd6895c0f26df59a4d8d84656d4c5cc697f7d18edeb62b41c84edc" }, "downloads": -1, "filename": "zombiedice-0.1.5.tar.gz", "has_sig": false, "md5_digest": "1d4f1a1afb3c1c3ac3b2cadd54f669e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 106344, "upload_time": "2019-02-11T21:58:55", "url": "https://files.pythonhosted.org/packages/6e/65/6634f96cd78683fa61cd117943684f2e7e6fb15b098150dc72a25fac6a31/zombiedice-0.1.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1d4f1a1afb3c1c3ac3b2cadd54f669e5", "sha256": "f3d8d72c40fd6895c0f26df59a4d8d84656d4c5cc697f7d18edeb62b41c84edc" }, "downloads": -1, "filename": "zombiedice-0.1.5.tar.gz", "has_sig": false, "md5_digest": "1d4f1a1afb3c1c3ac3b2cadd54f669e5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 106344, "upload_time": "2019-02-11T21:58:55", "url": "https://files.pythonhosted.org/packages/6e/65/6634f96cd78683fa61cd117943684f2e7e6fb15b098150dc72a25fac6a31/zombiedice-0.1.5.tar.gz" } ] }