{"id":15442860,"url":"https://github.com/highdiceroller/icepool","last_synced_at":"2025-12-27T05:50:06.478Z","repository":{"id":37244798,"uuid":"482375348","full_name":"HighDiceRoller/icepool","owner":"HighDiceRoller","description":"Python dice probability package.","archived":false,"fork":false,"pushed_at":"2024-05-29T08:05:35.000Z","size":92048,"stargazers_count":43,"open_issues_count":18,"forks_count":4,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-05-29T19:23:19.471Z","etag":null,"topics":["combinatorics","dice","dice-probabilities","jupyterlite","order-statistics","probability","python","python3","rpg"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/HighDiceRoller.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-04-16T22:33:20.000Z","updated_at":"2024-06-02T01:48:10.611Z","dependencies_parsed_at":"2023-11-24T06:48:09.879Z","dependency_job_id":"dd86c739-ab97-471f-9be1-8bce284a4f4c","html_url":"https://github.com/HighDiceRoller/icepool","commit_stats":null,"previous_names":[],"tags_count":63,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HighDiceRoller%2Ficepool","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HighDiceRoller%2Ficepool/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HighDiceRoller%2Ficepool/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/HighDiceRoller%2Ficepool/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/HighDiceRoller","download_url":"https://codeload.github.com/HighDiceRoller/icepool/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230511479,"owners_count":18237657,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["combinatorics","dice","dice-probabilities","jupyterlite","order-statistics","probability","python","python3","rpg"],"created_at":"2024-10-01T19:30:51.687Z","updated_at":"2025-12-27T05:50:06.472Z","avatar_url":"https://github.com/HighDiceRoller.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003cimg width=\"32\" height=\"32\" src=\"https://highdiceroller.github.io/icepool/favicon.png\" /\u003e Icepool\n\nPython dice probability package.\n\n[GitHub repository.](https://github.com/HighDiceRoller/icepool)\n\n[PyPi page.](https://pypi.org/project/icepool/)\n\nTry coding in your browser using [Icecup](https://highdiceroller.github.io/icepool/apps/icecup.html), a simple frontend for scripting and graphing similar to AnyDice, SnakeEyes, and Troll. You can find a series of tutorials [here](https://highdiceroller.github.io/icepool/notebooks/lab?path=tutorial%2Fc00_introduction.ipynb).\n\n## Features\n\n* Pure Python implementation using only the Standard Library. Run it almost anywhere Python runs: program locally, share Jupyter notebooks, or build your own client-side web apps using Pyodide.\n* Dice support all standard operators (+, -, \u003c, \u003e, etc.) as well as an extensive library of functions (rerolling, exploding, etc.)\n* Efficient dice pool algorithm can solve keep-highest, finding sets and/or straights, *RISK*-like mechanics, and more in milliseconds, even for large pools.\n* Exact fractional probabilities using Python `int`s.\n* Some support for decks (aka sampling without replacement).\n\n## Installing\n\n```\npip install icepool\n```\n\nThe source is pure Python, so including a direct copy in your project can work as well.\n\n## Contact\n\nFeel free to open a [discussion](https://github.com/HighDiceRoller/icepool/discussions) or [issue](https://github.com/HighDiceRoller/icepool/issues) on GitHub. You can also find me on [Reddit](https://www.reddit.com/user/HighDiceRoller) or [Twitter](https://twitter.com/highdiceroller).\n\n## API documentation\n\n[pdoc on GitHub.](https://highdiceroller.github.io/icepool/apidoc/latest/icepool.html)\n\n## JupyterLite notebooks\n\nSee this [JupyterLite distribution](https://highdiceroller.github.io/icepool/notebooks/lab/index.html) for a collection of interactive, editable examples. These include mechanics from published games, StackExchange, Reddit, and academic papers. \n\n[JupyterLite REPL.](https://highdiceroller.github.io/icepool/notebooks/repl/index.html?kernel=python\u0026toolbar=1\u0026code=%25pip%20install%20icepool%0Aimport%20icepool)\n\nAs a backup, you can [open the notebooks in Google Colab.](https://colab.research.google.com/github/HighDiceRoller/icepool)\n\n### Tutorial notebooks\n\nIn particular, here is a series of [tutorial notebooks.](https://highdiceroller.github.io/icepool/notebooks/lab?path=tutorial%2Fc00_introduction.ipynb)\n\n## StackExchange answers\n\n* [Call-on traits in *Burning Wheel*](https://rpg.stackexchange.com/a/216021/72732): Success-counting dice pools with explosions and rerolls.\n* [*Vampire the Masquerade V*](https://rpg.stackexchange.com/a/209266/72732)\n* [Roll multiple ability score arrays and pick the one with the highest total. What is the distribution of each ranked score?](https://rpg.stackexchange.com/a/214450/72732)\n* [*Year Zero Engine*](https://rpg.stackexchange.com/a/210217/72732)\n* [*Neon City Overdrive*](https://rpg.stackexchange.com/a/208640/72732)\n* [*Broken Compass* / *Household* / *Outgunned*](https://rpg.stackexchange.com/a/203715/72732)\n* [Probability that 0/4 players is dealt Blackjack](https://math.stackexchange.com/a/4817254/1035142)\n\n[Here is a full search of answers in which I mention Icepool.](https://rpg.stackexchange.com/search?q=user%3A72732+icepool)\n\n## Web applications\n\nThese are all client-side, powered by [Pyodide](https://pyodide.org/). Perhaps you will find inspiration for your own application.\n\n* [Icecup](https://highdiceroller.github.io/icepool/apps/icecup.html), a simple frontend for scripting and graphing.\n* Alex Recarey's [Face 2 Face Calculator](https://infinitythecalculator.com/) for *Infinity the Game* -- including the ability to be installed on Android and iOS and run without an internet connection.\n* [Ability score rolling method calculator.](https://highdiceroller.github.io/icepool/apps/ability_scores.html)\n* [Cortex Prime calculator.](https://highdiceroller.github.io/icepool/apps/cortex_prime.html)\n* [*Legends of the Wulin* calculator.](https://highdiceroller.github.io/icepool/apps/legends_of_the_wulin.html)\n* [Year Zero Engine calculator.](https://highdiceroller.github.io/icepool/apps/year_zero_engine.html)\n\n## Paper on algorithm\n\nPresented at [Artificial Intelligence and Interactive Digital Entertainment (AIIDE) 2022](https://sites.google.com/view/aiide-2022/).\n\n[In the official proceedings.](https://ojs.aaai.org/index.php/AIIDE/article/view/21971)\n\n[Preprint in this repository.](https://github.com/HighDiceRoller/icepool/blob/main/papers/icepool_preprint.pdf)\n\nBibTeX:\n\n```bibtex\n@inproceedings{liu2022icepool,\n    title={Icepool: Efficient Computation of Dice Pool Probabilities},\n    author={Albert Julius Liu},\n    booktitle={Eighteenth AAAI Conference on Artificial Intelligence and Interactive Digital Entertainment},\n    volume={18},\n    number={1},\n    pages={258-265},\n    year={2022},\n    month={Oct.},\n    eventdate={2022-10-24/2022-10-28},\n    venue={Pomona, California},\n    url={https://ojs.aaai.org/index.php/AIIDE/article/view/21971},\n    doi={10.1609/aiide.v18i1.21971}\n}\n```\n\n## Versioning\n\nFrankly, I haven't made backwards compatibility a top priority. If you need specific behavior, I recommend version pinning. Typing is especially unstable.\n\n## Similar projects\n\nIn roughly chronological order:\n\n### Troll by Torben Ægidius Mogensen\n\nhttp://hjemmesider.diku.dk/~torbenm/Troll/\n\nThe oldest general-purpose dice probability calculator I know of. It has an accompanying peer-reviewed paper.\n\n### AnyDice by Jasper Flick\n\nhttps://anydice.com/\n\nProbably the most popular dice probability calculator in existence, and with good reason---its accessibility and shareability remains unparalleled. I still use it often for prototyping and as a second opinion.\n\n### SnakeEyes by Noé Falzon\n\nhttps://snake-eyes.io/\n\nSnakeEyes demonstrated the viability of browser-based, client-side dice calculation, as well as introducing me to [Chart.js](https://www.chartjs.org/).\n\n### dice_roll.py by Ilmari Karonen\n\nhttps://gist.github.com/vyznev/8f5e62c91ce4d8ca7841974c87271e2f\n\nThis demonstrated the trick of iterating \"vertically\" over the outcomes of dice in a dice pool, rather than \"horizontally\" through the dice---one of the insights into creating a much faster dice pool algorithm.\n\n### `dyce` by Matt Bogosian\n\nhttps://github.com/posita/dyce\n\nAnother Python dice probability package. I've benefited greatly from exchanging our experiences.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighdiceroller%2Ficepool","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhighdiceroller%2Ficepool","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhighdiceroller%2Ficepool/lists"}