TS1000 Mystery Program

“How about a ‘Mystery Program’ for SWN? This would be something really bizarre, yet interesting to a lot of readers. We would supply nothing but a listing; no documentation, no explanation. Let ’em figure it out themselves!” -tbw

“Sounds great. I know just the program. Greg Harder wrote this nifty ______ program, called “______”. Only problem is, that it has an extensive BASIC listing with instructions, that would give it away. So, we could chop it down to the bare minimum to run the program. For those that never do figure it out, we could print the full BASIC portion in the subsequent issue. Greg, is it OK with you if we run your “______” in this fashion?” -fnn

“Sure, go for it. Sounds like fun.” -gch

So, here is the SWN “TS1000 Mystery Program.” Enter a mega-REM (1600 bytes) and Listing 1. After entering each of the five screens of hexcode shown below, your checksum should agree with that printed onscreen; if not, find which line(s) have errors, and repair them before going on.

Then delete the loader lines, enter line 5 SLOW, LIST 5, and POKE 16419,5. (Why?) Save this to tape for next time. Then add the lines of Listing 2, which is the bare-bones BASIC required to run the program. Save this also. What IS this program? When will we run the explanation? Don’t ask me, I’ve said too much already…. -fnn

LISTING #1

   1 REM "MEGA-REM", 1600 SPACES
LONG. SEE BASILS COMPENDIUM
SWN 4:1, OR OTHER ISSUES,OR
USE A TOOLKIT...............
............................
PEEK 16511+256*PEEK 16512
MUST RETURN 1602.
1200 REM HEX LOADER/EDITOR
1210 FAST
1220 CLS
1230 PRINT "START=";
1240 INPUT BASE
1250 LET SUM=0
1260 FOR L=1 TO 20
1270 GOSUB 1500
1280 NEXT L
1290 PRINT AT 21,0;"CHECKSUM=";SUM;" OK? Y/N "
1300 INPUT Y$
1310 IF Y$="N" THEN GOTO 1400
1320 IF BASE<>17794 THEN PRINT A
1330 STOP
1400 PRINT AT 21,0;"WHICH LINE IS WRONG (1-20)? "
1410 INPUT L
1420 GOSUB 1500
1430 LET SUM=0
1440 FOR N=BASE TO BASE+319
1450 LET SUM=SUM+PEEK N
1460 NEXT N
1470 GOTO 1290
1500 INPUT L$
1510 PRINT AT L-1,0;L$
1520 FOR N=0 TO 15
1530 LET V=16*(CODE L$(2*N+1)-28)+(CODE L$(2*N+2)-28)
1540 POKE BASE+16*(L-1)+N,V
1550 LET SUM=SUM+V
1560 NEXT N
1570 RETURN

HEXCODE LISTING

START = 16514

7676AF3222402A0C40062023368010FB
232336800615237EFE762804368818F6
2B36802323368010ED061F23368010FB
C92A0C40012B000901050B79E5C52336
8E10FB3D280AC10505E11122001918EC
C1E178192BE523368E10FB3D28050603
E118F0E179192B41E5368E2310FB3D28
03E118F1E1060378192BE523368E10FB
3D28050603E118F0E17906032323192B
2BE5C5368E2310FB3D2806C10404E118
EDC1E101F801ED423E05060BE5C51D36
8E1910FB3D2808C10505E11C1918EDC1
E1061423368E10FB0E7FED423E05060B
E5C5368E1910FB3D2809C10505E11D19
1C18EDC1E11919061A368E2B10FBED52
36921D1D193693017B01ED4236BB1C1C
061619368810FB36A6016D01ED420605
36882310FB2B2B2B3695C97EFE95C02A
5C4236973E0A112100010100E5093606
ED523606ED423603ED42368619368619

CHECKSUM = 27663

START = 16834

36060936830936860321210019EBF5C5
CD0C42C1F1E13D20D31E0B2A0C400618
2B237EFE76200410F81805C6807718F1
1D20E82A0C4001160309361C237E3DFE
3320043625180177AFC90100090B78B1
20FBC93E1EED47C9E53A344032334021
32407E07AE0F23862B77E1C9CD1A42E6
03C9CD1A42E60FC9CD1A42E60747CD1A
42E601803CA7C9CD1A42E607C9000000
00001C4C2A4C664D744D744D834DBE4E
CD1A42E601C92A0C4001230009225442
E5010E0009225642013C010922584201
0E0009225A42225C42010F0009225E42
013B0109226042E1CD3442FE05CA2D43
CD2E42FE012824FE02283FFE0328572A
58423612CD74453688CA684223CD9D41
C8EBCD0746EBCA684218E72A5642363B
CD74453688CA684201210009CD9D41C8
EBCD0746EBCA684218E42A5E423613CD
74453688CA68422BCD9D41C8EBCD0746

CHECKSUM = 28489

START = 17154

EBCA684218E72A60423626CD74453688
CA6842012100A7ED42CD9D41C8EBCD07
46EBCA684218E2000000003697225442
ED4B5642A7ED42E52025CD2E42FE0320
1E2A544201210009CD9D412002E1C9EB
CD0746280AEB363BCD7445368820E5E1
7DFE00200A2A5642012100092256422A
5442CD7445C8360823CD9D41C87EFE08
2808FE012804FE8020A1CD4942FE0220
1FE52A5642CD34422306004F097EFE80
280DFE08280936012A5C4209225E42E1
2B3697225442ED4B5E42A7ED42E52022
CD2E42FE03201B2A54422BCD9D412002
E1C9EBCD0746280AEB3613CD74453688
20E8E17DFE0020072A5E422B225E422A
5442CD7445C8360801210009CD9D41C8
7EFE082808FE872804FE8020A4CD4942
FE02202CE52A5E42CD3A424711210019
10FD7EFE802818FE0828143687A7ED52
ED5B5E42A7ED52EB2A5C4219226042E1

CHECKSUM = 31189

START = 17474

012100A7ED423697225442ED4B6042A7
ED42E52027CD2E42FE0320202A544201
2100A7ED42CD9D412002E1C9EBCD0746
280AEB3626CD7445368820E3E17DFE00
200C2A6042012100A7ED422260422A54
42CD7445C836082BCD9D41C87EFE0828
08FE022804FE80209DCD4942FE022027
E52A6042CD3442FE0F28F92B06004FA7
ED427EFE80280FFE08280B36022A5C42
A7ED42225842E1233697225442ED4B58
42A7ED42E52022CD2E42FE04201B2A54
4223CD9D412002E1C9EBCD0746280AEB
3612CD7445368820E8E17DFE0020072A
5842232258422A5442CD7445C8360801
2100A7ED42CD9D41C87EFE082808FE04
2804FE8020A2CD4942FE02202BE52A58
42CD3A4247112100ED5210FC7EFE8028
16FE082812360419ED5B5842A7ED52EB
2A5C4219225642E101210009C32D4300
0000E5EBCD0C422A5A427EFE95280236

CHECKSUM = 31403

START = 17794

88AFDBFEFE2F2018A7012100ED42225A
42CD074628087EFE88205C368C3CE1C9
FE3B201601210009225A42CD07462808
7EFE882042368C3CE1C9FE3D20132B22
5A42CD074628087EFE88202B368C3CE1
C9FE37201323225A42CD074628087EFE
882014368C3CE1C9ED5B5A422A5C42A7
ED522803EB36883C2A5C42225A42E1C9
00000000002A5A42E5A7ED52E1C00164
5A3606511520FD3686511520FD10F2CD
6242280236882A0C4001020309E57E3C
FE262803771805361C2B18F2E1060216
1C7EBA203B2B10F97E151506051414BA
280410F9182A011700097EFE25200736
342B361D1806FE3428023C773A0E42FE
01280D3D320E423A1246060A90321246
AF2A5C42225A42C90000002A0C400618
237EFE76200310F8C9EE807718F20000
00000000000000000000000017171717
17171717171717171717171717171717

CHECKSUM = 24701

LISTING #2

(Enter lower case letters in the reverse {graphic} video mode.)

   5 SLOW
20 LET DF=PEEK 16396+256*PEEK 16397
25 RAND USR 16516
190 RAND USR 18061
200 FOR N=1 TO 20
210 NEXT N
220 RAND USR 16516
230 RAND USR 16563
240 FOR N=1 TO 20
250 NEXT N
260 RAND USR 16516
270 PRINT AT 10,1;">>>>>FROM HARDER SOFTWARE.<<<<<"
290 FOR N=1 TO 40
300 NEXT N
340 CLS
380 RAND USR 16516
810 SLOW
850 LET B=9
860 POKE 16910,B
870 POKE 17938,B*10
880 PRINT AT 23,5;"press a key when ready"
890 GOTO 890+(INKEY$="")
900 GOTO 900+(INKEY$<>"")
920 RAND USR 16516
930 PRINT AT 23,0;" 00000 10"
940 RAND USR 16563
950 FOR N=0 TO PEEK 16910+3
960 NEXT N
970 RAND USR 17000
980 IF PEEK (DF+791)=28 THEN GOTO 1020
990 RAND USR 16516
1000 GOTO 940
1020 LET V=DF+767
1030 LET G$=CHR$ (PEEK V+128)+CHR$ (PEEK (V+1)+128)+CHR$ (PEEK (V+2)+128)+CHR$ (PEEK (V+3)+128)+CHR$ (PEEK (V+4)+128)
1040 CLS
1050 RAND USR 16516
1060 PRINT AT 3,11;"end pgmo;AT 8,5;"final [ ";G$;AT 13,7;"speed [ ";CHR$ (PEEK 16910+156);AT 18,5;"run again! {yn}"
1070 LET Y$=INKEY$
1080 GOTO 1070-290*(Y$="y")+20*(Y$="N")
1100 CLS
1110 FOR N=0 TO 30
1120 POKE 16918,N
1130 RAND USR 16917
1140 NEXT N
1150 STOP
9995 REM ***********************
9996 REM * SWN MYSTERY PGM. *
9997 REM * G.C. HARDER *
9998 REM * SEPT 1984 *
9999 REM ***********************

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.