The game: all tests
The game grows one test at a time. In each test, Fortran (the B side) does the maths, and 8086 Assembly (the A side) draws in a copy of a 1980s PC. A check then compares the answers of the two sides. GitHub Actions runs all checks for each change. If a check fails, the site does not change.
- Test 1The dot on a flat plane
Fortran makes a table of 256 sine values. 8086 Assembly draws the curve and moves a yellow dot along it: left to right, and up and down.
✓ The check passes: 256 of 256 answers agree.
- Test 2aThe dot in 3D
The same movement, with depth. The curve starts at the back and ends at the front, and its middle point is the center of the 3D space. The A side divides by the distance from the eye.
✓ The check passes: 256 of 256 answers agree.
- Test 2bWrong values, and the check
The program of test 2a with one wrong word: SHR, not SAR. Half of the dots go to wrong places. The check finds each wrong point, so a wrong program cannot get onto the site.
✗ The check fails, as it must: only 128 of 256 answers agree.
- Test 3aThe wave turns
The wave of test 2 goes from the back to the front. Now it turns around the center of the 3D space, and the dot moves along it. The A side turns each point with the sine and the cosine of the turn.
✓ The check passes: 4096 of 4096 answers agree.
- Test 3bA wrong quarter turn
The program of test 3a with one wrong value: 90 (a quarter turn in degrees), not 64 (a quarter turn in 256 steps). The ring becomes a tilted oval, and the wave grows and shrinks as it turns.
✗ The check fails, as it must: only 337 of 4096 answers agree.
- Test 4aThe decimal counter
A counter from 0000 to 9999 in two packed decimal bytes. The A side adds with ADD and ADC, and DAA makes each byte decimal again. The check tests all 10,000 values and the step after 9999.
✓ The check passes: 10000 of 10000 answers agree.
- Test 4bThe counter without DAA
The program of test 4a without the word DAA. After 0009 comes 000A, not 0010. The check finds 9,990 wrong values.
✗ The check fails, as it must: only 10 of 10000 answers agree.
Next
The game is a small lander game (decision D20). The tests come first, so that each new part of the maths has a check before the game uses it. The files are in the folder game/.