MatthijsFontys

Multiple Try Percentage Treshold Check

Apr 15th, 2022
892
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. function calcAddPercent(startPercent, thresholdPercent = 95) {
  2.     let currentPercent = startPercent;
  3.     let ballCount = 1;
  4.     while(currentPercent < thresholdPercent) {
  5.         currentPercent += (100 - currentPercent) * (startPercent / 100);
  6.         ballCount ++;
  7.     }
  8.     return ballCount;
  9. }
Advertisement
Add Comment
Please, Sign In to add comment