PDA

View Full Version : Heroscape Probability Calculator


Obsidian
June 28th, 2009, 12:47 PM
This site already has probability tables (http://www.heroscapers.com/community/showthread.php?t=16263), but I wanted something that could be flexible, calculate on the fly, or take really extreme situations just for curiosity's sake. The Heroscape Probability Calculator is designed to do that.

This code is not perfect, and I am sharing the source code with everyone so they can look at, critique, and maybe learn from it.

You will need python on your machine to run this code.
-Go to http://www.python.org/download/ and look for the latest download. The link should be towards the top of the page. As of this date, 3.0.1 is the latest version.
-Under the Download section, choose the version that best works for your machine. Click on the link and save the executable file.
- Run the executable file and follow the instructions on the install wizard.
-There should now be a python folder in the directory you specified during the install. In this folder you will find IDLE (Python GUI). Open it.
- This python shell is where you will run the Heroscape Probabilities Calculator. Click File -> New Window.
- You can find the code in a text file here (http://www.heroscapers.com/community/downloads.php?do=file&id=1681). Copy and paste this text into the new window of your python shell.
- You can now run the file by clicking Run -> Run Module (Or you can press F5).

Now that you have the code running, type the name of the function you want, and fill in the parameters. If you wanted to know the odds that you will get at least two wounds on Braxus with Sargent Drake, type: atLeastWounds(6,3,2) then press enter. The 6 is for Drake's attack value, 3 for Braxus's defense value, and 2 for 2 wounds.

Obsidian
June 28th, 2009, 12:49 PM
Version 1.1 Download it here (http://www.heroscapers.com/community/downloads.php?do=file&id=1681).

AliasQTip
June 28th, 2009, 07:44 PM
I don't keep a laptop next to me while playing HeroScape so I just use a printed copy of my Dice Probability Chart (http://www.heroscapers.com/community/downloads.php?do=file&id=1002). However, I might borrow some of your code for a program for my TI89 calculator. That'd be pretty cool. Nice work.

Obsidian
June 28th, 2009, 09:43 PM
I don't keep a laptop next to me while playing HeroScape so I just use a printed copy of my Dice Probability Chart (http://www.heroscapers.com/community/downloads.php?do=file&id=1002). However, I might borrow some of your code for a program for my TI89 calculator. That'd be pretty cool. Nice work.

Cool table.
That would be awesome to have a TI89 program...it would be awesome to have a TI89.