3 ms·
It's not that it's non-deterministic, it's just that, since your javascript interpreter doesn't execute each instance and its event handlers in parallel, each i
by aperiodic 16y ago
It's not that it's non-deterministic, it's just that, since your javascript interpreter doesn't execute each instance and its event handlers in parallel, each instance will receive slightly different inputs. This is because the number of times each instance's main loop fires before its keyup/down handler gets called will vary.
If you load up, say, 6 instances, hold the up button for a while to get them up to full speed, then turn for 4 or 5 seconds and let go, they'll be a bit divergent, but not too badly. They should all be going roughly the same direction, and wrapping around at roughly the same time.
If you load up 6 instances again, hold the up button for a while, and then turn back and forth very rapidly for a short period of time, they'll be much more divergent.