Slots
writing a program to calculate losses and victory in a war game for social media
https://paste.mod.gg/ibvjrtpjsjua/0
I have completed the victory randomizer part and the hit points calculation, now I need to calculate the losses using those hit points.
i'm going off the below text for it:
"it then calculates the losses of each side using a double randomizer, and it chooses a percentage in the form of a float ranging from 0.01 to 1. this calculation is done twice for both sides, and after multiplying the hit points of each side by the other sides chosen loss float the numbers are rounded to the nearest 1 and the final loss results are the total losses for each side, both losses kept seperate."
my current issue is how i would start to calculate it, as the calculations are done inside of 2 if/else statements for all 4 possible offensive/defensive scenarios.
80 replies
writing a program to calculate losses and victory in a war game for social media
I updated the paste code: https://paste.mod.gg/gczqzmpbdcuh/0
80 replies
writing a program to calculate losses and victory in a war game for social media
The finished product is meant to take in values from two sides, troops, tanks and artillery on one side, and the same on the other. Based off which side is on the offensive or the defensive, it calculates the losses, and should use a randomizer to decide which side wins.
TL;DR, calculates losses, randomizes the victory
80 replies