Test 3b: a wrong quarter turn
This is the program of test 3a with one wrong value. A quarter turn is 90 degrees, so a programmer wrote 90. But in this program, a full turn has 256 steps, not 360 degrees. A quarter turn is 64 steps. With 90, the ring on the floor is a tilted oval, not a circle. The wave grows and shrinks while it turns, and it turns at a speed that changes.

A The wrong value
In src/spin3d.inc, the program reads the cosine of the turn a quarter turn after the sine.
QUARTER_TURN equ 64right: 256 steps / 4QUARTER_TURN equ 90wrong: 360 degrees / 4
With 90, the program reads the "cosine" 26 steps too late. X and Z are then not at a right angle. The assembler cannot know this: 64 and 90 are both good numbers.
Waiting for the copy of the PC to start…
Compare with the correct program in test 3a. Look at the magenta ring: it must be a circle (a flat oval in perspective, left to right). Here it is tilted. Look at the wave: it must keep its length.

B What the check sees
From above: the right wave (green) and the wrong wave (red), for the turn now.
The check report
The test program runs the wrong routine for 16 turns and 256 angles, and writes the answers toR3DW.BIN. The checker (lab/check_spin.f90) compares them with its own answers:
File: R3DW.BIN
A side and B side agree on 337 of 4096 points
Largest difference from the exact maths: 21 pixel(s)
ERROR STOP The A side and the B side disagree.The wrong points for each of the 16 turns that the check tests (256 points for each turn):
How one wrong value breaks the game
- The shapes change. A turn must keep each shape the same. With 90, the wave is longer at some turns and shorter at others. In the lander game, the ship would stretch and shrink when it turns.
- The speed changes. The wave must turn at the same speed all the time. With 90, it turns quickly for some steps and slowly for others. The player would see a jump in each turn.
- The game logic uses wrong places. A game uses the same numbers to find out if the ship touches the ground. With wrong numbers, the ship can land in the air or go through the ground.
- The picture can hide the error. At some turns, the wrong wave is near the right wave, and the error is small. A person who looks at one picture can miss it. The check compares each number at 16 turns and finds wrong points at each turn.
- The check guards the site. The build requires the check to fail on this wrong program. If the check does not find the error, the check itself is broken, and the build stops.
The wrong program comes from the same files as test 3a. NASM builds it with the switch -dWRONG_TURN, which changes only the one value (see src/spin3d.inc). The panels of this page calculate the wrong program in the browser with the same steps. The check report comes from the real test in DOSBox.