Thanks for all the good help here, @bsiever, and sorry everyone for not being able to let go of this subject!
But I was intrigued by an assignment we got at a teacher’s seminar to program a reaction game using the micro:bit and some wires and aluminum foil. However, regardless of how much we tried to optimize the code there, and some efforts made in a discussion forum afterwards, I cannot get it to not feel somewhat sluggish nor shake the impression that the game is not entirely fair, depending the order of checking in the code and/or the intricacies of how the micro:bit hardware/system works, given everything very well described here:
https://makecode.microbit.org/device/reactive
Even though I am a noob without access to the required measuring equipment to test this scientifically and not yet have enough technical/coding skills to achieve this on my own, I am still motivated to start afresh to make a fairly good reaction game on the micro:bit.
Does anyone know if it with MakeCode on the micro:bit actually is possible to make a reaction game which is (or already has such working code to share):
- Quick enough?
- Fair? (uniform distribution or undecided if inputs happen exactly simultaneously (or within reasonable short intervals of eachother)
- Excact? (first input always wins, only one input per player, not possible to fill buffers with inputs, disqualified if input arrives before start signal)
(Or, at least, emulates well enough to feel like all of the above.)
I would guess that some of @bsiever’s fast loops above might help, and maybe something like @joshkeys19’s debouncer is required? But my attempts so far have not been especially reactive or exact / fair, and are now thrown away awaiting a fresh start / perspective.
Any help would be greatly appreciated!