I'm trying to make a program that calculates your k/d ratio (kill/death, which is used in FPS games to make people believe that it's skill), how many kills you need without dying once to reach a goalKD. It also has a part that calculates how many battles you need if you give the program your average battle kills and battle deaths.
Is there a efficient way to program it? Currently, the way I'm doing it is getting me into programmer-efficiency hell.
For i = 1 to 100000 {
While GoalKD>KDratio {
Kills = BattleKills + Kill
Deaths = BattleDeaths + Death
KDratio = Kills / Deaths
i++
}
}
I'm programming this in SmallBasic because I'm most familiar with it, and I think it's easily readable. Also, if possible, don't give the answer right away; give me some hints for me to practice my mind. Add the answer in a spoiler box.
while
loop that affects its condition, so you would get stuck there. \$\endgroup\$ – Guffa Dec 20 '13 at 1:36