For convenience in programming and display, the numbers 1 to 19 are
represented by the letters A to S. At the start of the search, and when a solution has
been found, the program pauses to allow the position to be noted down. Any key
depression will cause the search to be resumed. The program terminates when there
are no further possible arrangements.
The first solution will be found in just over four minutes, and the second in
another two and a half minutes (at 4 Mhz). Further solutions will require considerably
more patience, but those interested enough may wish to run the program
exhaustively in order to uncover all the possible arrangements and discover if there
exists more than one unique solution.
Program Listing
0C80 | 3E 0C | | LD A, 0CH |
0C82 | F7 | | RST ROUT |
0C83 | 01 11 00 | | LD BC, 11H |
0C86 | 11 1A 08 | | LD DE 081AH |
0C89 | 21 A9 0D | | LD HL, TITLE |
0C8C | ED B0 | | LDIR |
0C8E | 3E 3F | | LD A, 3FH |
0C90 | CD 28 0D | | CALL HEXGON |
0C93 | 3E 41 | | LD A, 41H |
0C95 | 06 13 | | LD B, 13H |
0C97 | 21 99 0B | | LD HL, 0B99H |
0C9A | 77 | TABLE | LD (HL), A |
0C9B | 3C | | INC A |
0C9C | 23 | | INC HL |
0C9D | 10 FB | | DJNZ TABLE |
0C9F | DF 7B | | SCAL BLINK |
0CA1 | 3E 20 | | LD A, 20H |
0CA3 | CD 28 0D | | CALL HEXGON |
0CA6 | 03 | FORWRD | INC BC |
0CA7 | 3E 14 | | LD A, 14H |
0CA9 | B9 | | CP C |
0CAA | 28 4D | | JR Z, SOLN |
0CAC | CD 15 0D | | CALL HEXLOC |
0CAF | 3E 40 | | LD A, 40H |
0CB1 | 21 98 0B | | LF HL, 0B98H |
0CB4 | 3C | NXTNUM | INC A |
0CB5 | FE 54 | | CP "T |
0CB7 | 28 44 | | JR Z, REPLAC |
0CB9 | 23 | | INC HL |
0CBA | BE | | CP (HL) |
0CBB | 20 F7 | | JR NZ, NXTNUM |
0CBD | 12 | | LD (DE) A |
0CBE | 36 20 | | LD (HL), 20H |
0CC0 | F5 | | PUSH AF |
0CC1 | E5 | | PUSH HL |
0CC2 | 21 5B 0D | | LD HL, CHKLST |
0CC5 | 09 | | ADD HL, BC |