0xf00ff00f / rotator

Other
157 stars 8 forks source link

"NaN" result in the null game #1

Closed tallforasmurf closed 2 years ago

tallforasmurf commented 2 years ago

If you tap to start, and then let the timer run without making any choices, after two minutes it tells you "NaN seconds per shape". Better to just leave off the second line of the message when "0 shapes rotated".

0xf00ff00f commented 2 years ago

Yeah, the NaN is there on purpose:

https://github.com/0xf00ff00f/rotator/blob/master/demo.cc#L419

I'll replace it with an infinity symbol. :)

tallforasmurf commented 2 years ago

To a programmer it looks like it divided by 0 (pairs) and didn't catch the exception. So, yeah.

0xf00ff00f commented 2 years ago

Removed the NaN when there are no matches, thanks. (Also replaced the time average with accuracy, which is a better stat.)