Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Another easy one... Timer problem?
#2
The issue is that `score` isn't cumulative, instead it's set equal to `Pick * 10 - TimePenalty` on each loop. `TimePenalty` is only the penalty for the current loop, it doesn't include any penalties for previous loops - even though there was a 1 point penalty on the previous loop to get 39 that penalty is lost when you do the next loop and `TimePenalty` is set to 0 (because you're within the 5 second window).

A simple solution is to do `TimePenalty = TimePenalty + Int((T2 - T1) / 5)`, that way `TimePenalty` will include any penalties from previous loops.

Alternatively you could stop using `Pick` and do `Score = Score + 10 - TimePenalty`, so that way score retains the penalties.

Of course, don't do both of the options or you'll double-count the penalties Big Grin
Reply


Messages In This Thread
RE: Another easy one... Timer problem? - by DSMan195276 - 03-19-2025, 06:05 AM
RE: Another easy one... Timer problem? - by bplus - 03-19-2025, 10:53 AM
RE: Another easy one... Timer problem? - by bplus - 03-19-2025, 11:24 PM
RE: Another easy one... Timer problem? - by Pete - 03-20-2025, 01:16 AM
RE: Another easy one... Timer problem? - by Pete - 03-21-2025, 06:23 PM



Users browsing this thread: 1 Guest(s)