# Probability Calculator

## Recommended Posts

Hi everyone. I have written a probability calculator for legion using C#

You put in the attacking and defending unit info, then the program simulates the attack steps thousands of times to determine the probability of each outcome. It will output the probability of each number of hits, the probability of getting at least a number of hits, the average, the median, the mode, and the standard deviation.

The code is available on GitHub:

or if you don't care about the code and just want to run the exe you can get that here:

I am using 64bit windows 10 and haven't tested the program on anything else. I am not a professional programmer and haven't used GitHub before so any suggestions are welcome.

Edited by Qark
Updated software

##### Share on other sites

Sweet! thanks for this..

Insane!!

##### Share on other sites

Is simulating easier than calculating?

##### Share on other sites
37 minutes ago, Rumar said:

Is simulating easier than calculating?

To program,  yes. Computationally,  probably not. It was the simplest way I could think of to cover every  possible combination of dice and abilities.

##### Share on other sites

Looks great. Units can have more than one Dodge or Aim token, right? Would that need to be accounted for?

##### Share on other sites
2 hours ago, KalEl814 said:

Looks great. Units can have more than one Dodge or Aim token, right? Would that need to be accounted for?

You are correct! Ill make an update.

##### Share on other sites

I think that is all working now. Links above are now for the new version.

##### Share on other sites

this calc is amazing.  makes me rethink everything!

##### Share on other sites
On 4/10/2018 at 6:37 PM, Qark said:

Hi everyone. I have written a probability calculator for legion using C#

You put in the attacking and defending unit info, then the program simulates the attack steps thousands of times to determine the probability of each outcome. It will output the probability of each number of hits, the probability of getting at least a number of hits, the average, the median, the mode, and the standard deviation.

The code is available on GitHub:

or if you don't care about the code and just want to run the exe you can get that here:

I am using 64bit windows 10 and haven't tested the program on anything else. I am not a professional programmer and haven't used GitHub before so any suggestions are welcome.

Any chance of an update for danger sense? Love the tool (so does discord!)

##### Share on other sites

Dang this is awesome. Certainly bests me asking my mathematician sister to explain dice probabilities to me 🤣

##### Share on other sites

Nice, great job.

##### Share on other sites
4 hours ago, DwightE1 said:

Any chance of an update for danger sense? Love the tool (so does discord!)

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

Edited by Qark

##### Share on other sites
1 hour ago, Qark said:

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

Phht! At least once after every game to see if my stupid decision was the right move!  Someone did a huge breakdown on the discord today with pathfinders vs everything.

##### Share on other sites
14 hours ago, Qark said:

Yeah I can do that. Should also put in Armour X. Any thing else I have missed? It'll take a few days. I had no idea anyone was actually still using this thing.

uncanny luck i think is the only other thing [for han]

Edited by Matt3412

##### Share on other sites
17 hours ago, OccasionallyCorrect said:

Phht! At least once after every game to see if my stupid decision was the right move!  Someone did a huge breakdown on the discord today with pathfinders vs everything.

That was me. Suuuuper useful.

##### Share on other sites
On 2/19/2019 at 6:05 AM, DwightE1 said:

Any chance of an update for danger sense? Love the tool (so does discord!)

I think all the new things are working. Didn't get much of a chance to test so if you notice something wrong let me know. Links above should still work.

##### Share on other sites

Id love to see this as an android app. Great app thanks for what youve done.

##### Share on other sites

Above links updated with a few changes.

• Max damage now at 25 to account for Fire Support
• Surge tokens included
• Critical keyword included
• Shield tokens included
• Changed layout slightly

Links above should still work but here is the .exe link again just in case: https://github.com/andrew-s-hart/SW-Legion-Probability-Calculator/raw/master/LegionCalculator.exe

If I have missed any new keywords or you find a bug let me know!

##### Share on other sites
On 2/20/2019 at 11:41 PM, The captn said:

Id love to see this as an android app. Great app thanks for what youve done.

Me too

Great work though, I'd not seen this before so will try it out on my computer.

##### Share on other sites

Updated for RAM because @sigidi's calculator had more features than mine and we couldn't let that happen. Check their calculator out in the other thread (https://community.fantasyflightgames.com/topic/303327-dice-simulator/). It runs in browser so it might work on a phone!

##### Share on other sites

A reset button would be nice for yours

##### Share on other sites

doesn't this sap all the excitement from the game if you know what is going to happen most if not all the time?

##### Share on other sites
7 hours ago, XR8rGREAT said:

doesn't this sap all the excitement from the game if you know what is going to happen most if not all the time?

No, because dice will be random. Red dice will fail. However this does give you good stats to base a strategy or a tactic on. I started mine because i wanted to know if mathematically 1 red and 3 white attack dice is better or worse than 2 red. Now I know in practice the white dice will fail me every time. At least that's what i think. But as it turns out they are actually better. So now I can base my choice on math instead of gut feeling. However in practice they will indeed fail me every time

Edited by sigidi

## Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

×   Pasted as rich text.   Paste as plain text instead

Only 75 emoji are allowed.

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×

×

• #### Activity

×
• Create New...