Board game probability calculator




















At that rate, it would take 40 hours of non-stop processing to find the probabilities for a blank board. Random samples are the only solution while the first couple of ships remain unsunk, because the probabilities are not easy to calculate mathematically. It would be nice if there were a simple formula that could act as a shortcut around all of those iterations, but if there is, no one seems to have figured it out yet. When sampling ship locations, the algorithm assumes that all possible ship locations are equally likely — in other words, it's assumed that your opponent placed their ships randomly.

This could be considered a weakness, especially early in the game: if your opponent knows how the algorithm works, they'll place their ships away from the squares they know you'll try first. But as the game proceeds, this strategy will be less and less effective as your enemy's ships are restricted to the outer edges of the board. Also, when the simulator is taking random samples early in the game, the numbers of samples sometimes represent a tiny fraction of the number of possible ship configurations, which means the simulator will occasionally produce odd results.

For example, if you run the program twice for the same layout, sometimes you'll get two different answers for the best square. However, I did check the probabilities against a completely rigourous program I wrote in the much faster language, C which means no fancy web version, sorry , and found that the random method produces satisfyingly accurate results. In an earlier version of the program, sample ship configurations were generated naively — that is, by choosing spots on the board without first considering the user input — and then each new configuration was checked against the user's current board layout before getting counted.

This turned out to be a terrible idea: a huge number of configurations ended up getting rejected, which meant a lot of processing time was being wasted. The solution to this problem was to start with a list of all possible locations for each ship, eliminate locations that are impossible given the user input, then draw ship locations from this reduced list when testing configurations. This elimination process is pretty complex lines of code!

Auto-update: With this option turned off, the simulator will wait for the user to press the "Update" button before starting another simulation.

Show percentages: Shows each square's measured hit probability. Pulling any other card you lose. Probability vs. Basic Calculator. Games, Tools. Odds Probability Calculator. A:B Odds Probability Calculator. It supports arbitrary numbers of arbitrary-sided dice. Dice do not have to have the same number of faces. Input files should be saved as plain text. When entering the name of the input file, omit the.

The program outputs a comma-separated value. This file can be viewed in most spreadsheet programs. Skip to content. Star 1. A simple dice probability calculator tool for board game development 1 star 0 forks. Branches Tags.



0コメント

  • 1000 / 1000