Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thechymera/risky
Per-attack dice odds calculator for Risk-like games
https://github.com/thechymera/risky
Last synced: about 2 months ago
JSON representation
Per-attack dice odds calculator for Risk-like games
- Host: GitHub
- URL: https://github.com/thechymera/risky
- Owner: TheChymera
- License: gpl-3.0
- Created: 2014-07-26T02:09:25.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2014-09-01T18:09:33.000Z (over 10 years ago)
- Last Synced: 2024-04-29T00:10:06.445Z (9 months ago)
- Language: Python
- Homepage:
- Size: 207 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
#Risky
Python functions with a convenient command line interface (`risky_cli.py`) to calculate the odds for single-attack battles in Risk-like games.
The function lets you specify many variations including number of attacking units, defending units, and even dice sides.
We use either formulaic odds calculation or explicit lookup from tables of all outcome possibilities (the latter being significantly slower for large dice side numbers).A more in-depth explanation of the formulas, as well as reference odds tables for popular game configurations can be found in the script's [tutorial page](http://chymeric.eu/blog/2014/07/23/per-attack-risk-dice-odds/).
##Dependencies
* **[NumPy](https://en.wikipedia.org/wiki/Numpy)** - in [Portage](http://en.wikipedia.org/wiki/Portage_(software)) as **app-text/texlive**
##Usage
Run the script from the containing folder:
```
python risky_cli.py [-h] [-f] [-d DICE_SIDES] attackers defenders
```Example (7-sided dice, 4 attacking dice are rolled against 1 defending dice):
```
python risky_cli.py -d 7 4 1
```##Arguments
```
positional arguments:
attackers number of attacking units (integer 1 to 3)
defenders number of defending units (integer 1 to 2)optional arguments:
-h, --help show this help message and exit
-f, --force-lookup force usage of the odds_lookup (non-formulaic, slow)
method
-d DICE_SIDES, --dice-sides DICE_SIDES
specify the number of faces on the dice
```Released under the GPLv3 license.
Project led by Horea Christian (address all e-mail correspondence to: [email protected])