Giter Club home page Giter Club logo

risk-simulator's Introduction

Risk Simulator

Risk README intro

WHY

Are you tired of getting your butt kicked when playing the popular "Risk" board game with your friends? Well I feel you bro, I am as well.
But today may be your lucky day: use the "Risk simulator" to learn with pinpoint accuracy what are the odds of your attack (or defense) to be successful and dramatically improve your chances of winning, so that YOU can be the one kicking everyone else's butt at the table next time.

WHAT

  • Insert the no. of attacking armies (red armies)
  • Insert the no. of defending armies (blue armies).
  • Specify how many armies you want to keep on the ground before stopping the attack.
    E.g. you attack with 10 red armies, while 6 blue armies are defending. You decide to stop the attack when 2 red armies are left on the ground in order to preserve the territory and not let it completely unguarded.
  • Finally, decide how many attack simulations to run (up to 1,000,000).

The program will roll the dice for you and compute as many attack outcomes as specified by the simulation number. It will compute the no. of successful attacks won by red armies and the no. of successful defenses won by blue armies, eventually computing the odds of a successful attack (or defense).

HOW

The program's logic is based upon the Monte Carlo Simulation method, a mathematical technique that predicts possible outcomes of an uncertain event by means of repeated random sampling versus a set of fixed input values.
In other words, a Monte Carlo Simulation builds a model of possible results by leveraging a probability distribution, such as a uniform or normal distribution, for any variable that has inherent uncertainty (i.e. dices). It then recalculates the results over and over, each time using a different set of random numbers between minimum and maximum values and a given set of fixed input variables (i.e. the no. of red and blue armies, as well as the no. of red armies to keep on the ground).
In a typical Monte Carlo experiment, this exercise can be repeated thousands of times to produce a large number of likely outcomes.

risk-simulator's People

Contributors

marcosperindeo avatar

Watchers

Kostas Georgiou avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.