Micro­power

  

Volume 1 · Number 4 · December 1981

Page 24 of 33

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

0C803E 0CLD A, 0CH
0C82F7RST ROUT
0C8301 11 00LD BC, 11H
0C8611 1A 08LD DE 081AH
0C8921 A9 0DLD HL, TITLE
0C8CED B0LDIR
0C8E3E 3FLD A, 3FH
0C90CD 28 0DCALL HEXGON
0C933E 41LD A, 41H
0C9506 13LD B, 13H
0C9721 99 0BLD HL, 0B99H
0C9A77TABLELD (HL), A
0C9B3CINC A
0C9C23INC HL
0C9D10 FBDJNZ TABLE
0C9FDF 7BSCAL BLINK
0CA13E 20LD A, 20H
0CA3CD 28 0DCALL HEXGON
0CA603FORWRDINC BC
0CA73E 14LD A, 14H
0CA9B9CP C
0CAA28 4DJR Z, SOLN
0CACCD 15 0DCALL HEXLOC
0CAF3E 40LD A, 40H
0CB121 98 0BLF HL, 0B98H
0CB43CNXTNUMINC A
0CB5FE 54CP "T
0CB728 44JR Z, REPLAC
0CB923INC HL
0CBABECP (HL)
0CBB20 F7JR NZ, NXTNUM
0CBD12LD (DE) A
0CBE36 20LD (HL), 20H
0CC0F5PUSH AF
0CC1E5PUSH HL
0CC221 5B 0DLD HL, CHKLST
0CC509ADD HL, BC
Page 24 of 33