Skip to content
/ RISK Public

A Python script to calculate winning probabilities in the board game Risk

License

Notifications You must be signed in to change notification settings

IanYHWu/RISK

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

RISK

A Python script to calculate winning probabilities in the board game Risk.

Alt Text

The script outputs a table containing the probabilities of the attacker gaining territory, given specific numbers of attackers and defenders involved in a conflict.

In addition to being useful for decision-making while in game, this project is also a nice application of dynamic programming. It is able to accurately and very quickly compute results for conflicts involving hundreds of units (although the graph will not be able to present this data nicely).

Installation

Clone from git using: git clone https://github.com/HerrHruby/RISK.git

Usage

An example table for conflicts involving up to 20 units on each side is available in the samples file. The corresponding probability surface is also available in the same folder.

Alt Text

The main script risk.py is contained in the src folder. To run the script, call python risk.py from the command line.

The basic_rolls.py file is used to estimate the probabilities of each side winning a "basic" conflict - one involving a small and unique combination of troops that can be resolved with a single set of dice throws. This does not need to be run directly, as the results are already contained in the main file.

About

A Python script to calculate winning probabilities in the board game Risk

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages