Open stsawyer opened 8 years ago
Agreed. I have two ways to solve this:
Any other ways? I think I could do #1 with your help/google searching.
I would honestly change the way getTimeRemaining works altogether. You don't need to roll each digit independently, just roll how many seconds there are left in the game (1 to 300 or so) and then reformat into minutes : seconds with a division and a modulus (remainder) operator.
totaltime = (random from 1 to 300) minutesLeft = totalTime / 60; //if this isn't don't integer math you'll also need a floor here secondsLeft = total time % 60;
Not all of the selected times make sense under the valid return value of 0:00 left. As an example, a fumble after the clock has run out on the last play only really matters in very specific circumstances.