Reflex Game Specification

We want to program the following reflex game machine.

The player controls the machine with the three buttons on the ZDS-II:

The machine reacts to these commands by operating the following devices, which use the ZDS-II MODEM LED's connected to J3:

When the machine is turned on the display shows the digit zero, the GAME_OVER lamp is on the GO and TILT lamps are off. The player then starts a game by inserting a coin. The normal behavior is as follows:

Each game is composed of a fixed number MEASUREUMBER of reflex measures, five in our sample program. A measure starts when the player presses the READY button; then after a random time the GO lamp turns on and the player must press the STOP button as fast as he can. When he does so the GO lamp turns of and the reflex time measured in milliseconds is displayed on the numerical display. A new measure starts when the player presses READY again. When the cycle of MEASUREUMBER measures is completed the average reflex time is displayed after a pause of PAUSE_LENGTH milliseconds and the GAME_OVER lamp is turned on.

There are five exception cases. Two of them are simple mistakes and make the bell ring:

In the next three cases the TILT and GAME_OVER lamps are turned on the GO lamp is turned on and the game ends:

A last anomaly appears if the player inserts a coin during a game. Then a new game is started afresh at once.