Labyrinth

Products: Labyrinth
Date: 1982
Type: Cassette
Platform(s): TS 1000

This is a quickload program. It is comprised of a short speed loader in normal ZX81/TS1000 format followed by the actual program in a format similar to the Spectrum and TS2068 tape format.

  • Labrinth.wav is the file directly from the tape with fades and dropouts corrected.
  • Labrinth1.wav has been edited to remove noise and provide more of a square wave signal.

Related Products

Pick your maze; from small and simple to complex. The maze is displayed for a few minutes to let you memorize your way through. Then the maze vanishes and you have to find your way just as if you were stuck in a maze. If you get lost, signal for help and the computer will

Gallery

Labyrinth

Source Code

   1 REM  \' \ '\. \' 
   2 REM \21\84\40\3E\02\BE\C8\21\82\40\AF\BE\CA\BE\40\2A\0C\40\23\23\36\86\11\22\00\19\36\86\11\94\02\19\36\06\11\20\00\19\36\06\C3\E0\40
   3 REM E£RND7)5 ;\.'\''Q\..7( CLS )%)\ ';\.'\''Q\''7( CLS /\.'
   4 REM \21\83\40\AF\BE\CA\0D\41\2A\0C\40\23\11\1E\00\19\36\06\11\20\00\19\36\06\11\94\02\19\36\86\11\22\00\19\36\86\C3\30\41
   5 REM E£RND7)Y ;\.'\''Q\..7( CLS )%)\ ';\.'\''Q\''7( CLS /\:'% 
   6 REM E£RND)Z ;\.'<)\.' ;Q\ :). ;Q\: ( PAUSE /\:'% 
   7 REM \21\84\40\AF\BE\C8\2A\0C\40\23\11\24\00\19\06\1A\36\83\23\10\FB\11\7A\02\19\06\1A\36\03\23\10\FB\C9\80\80
  12 REM \21\82\40\AF\BE\CA\AC\41\2A\0C\40\23\11\45\00\19\36\86\11\22\00\19\36\86\19\36\86\11\CE\01\19\36\06\11\20\00\19\36\06\19\36\06\C3\CF\41
  13 REM E£RND7)\ . ;\.'\''Q\..7( CLS )ACS \' ;\.'\''Q\''7( CLS /\:'% 
  14 REM \21\83\40\AF\BE\CA\02\42\2A\0C\40\23\11\5E\00\19\36\06\11\20\00\19\36\06\19\36\06\11\CE\01\19\36\86\11\22\00\19\36\86\19\36\86\C3\25\42
  15 REM E£RND7)%2 ;\.'\''Q\..7( CLS )ACS \' ;\.'\''Q\''7( CLS /\:'% 
  16 REM E£RND)%3 ;\.'$)£ ;Q\ :)+ ;Q\: ( PAUSE /\:'% 
  17 REM 5\':RND%J%YCOS E£RND7)\!! ;\.'=Q\..7( CLS )%U\' ;\.'=Q\''7( CLS TAN 
  22 REM \21\82\40\AF\BE\CA\99\42\2A\0C\40\23\11\AB\00\19\36\86\11\22\00\19\36\86\11\4A\01\19\36\06\11\20\00\19\36\06\C3\B8\42
  23 REM \2A\0C\40\23\11\CC\00\19\36\83\23\36\83\11\49\01\19\36\03\23\36\03\18\07\80
  24 REM \21\83\40\AF\BE\CA\E5\42\2A\0C\40\23\11\BE\00\19\36\06\11\20\00\19\36\06\11\4A\01\19\36\86\11\22\00\19\36\86\C3\04\43
  25 REM \2A\0C\40\23\11\DE\00\19\36\83\23\36\83\11\49\01\19\36\03\23\36\03\18\07\80
  26 REM E£RND7) THEN  ;\.'\,,)( ;Q\ :)) ;Q\: ( PAUSE /\:'% 
  27 REM 5\':RND%J%YCOS E£RND7)EXP  ;\.'(Q\..7( CLS )U\' ;\.'(Q\''7( CLS TAN 
  32 REM \21\82\40\AF\BE\CA\6D\43\2A\0C\40\23\11\EF\00\19\36\86\11\08\01\19\36\06\C3\86\43
  33 REM E£RND7) LOAD  ;Q\..)\##\' ;Q\''/\:'% 
  34 REM \21\83\40\AF\BE\CA\A7\43\2A\0C\40\23\11\FE\00\19\36\06\11\08\01\19\36\86\C3\C0\43
  35 REM E£RND7) RETURN  ;Q\..)\##\' ;Q\''/\:'% 
  36 REM E£RND7) RETURN  ;\.'\:')> ;Q\ :)? ;Q\: ( PAUSE /\:'% 
  37 REM 5\':RND%J%YCOS E£RND7) LIST  ;\.':Q\..7( CLS ) IF  ;\.':Q\''7( CLS TAN 
  42 REM \21\82\40\AF\BE\CA\29\44\2A\0C\40\23\11\11\01\19\36\86\11\C6\00\19\36\06\C3\42\44
  43 REM E£RND7))\' ;Q\..)LEN  ;Q\''/\:'% 
  44 REM \21\83\40\AF\BE\CA\63\44\2A\0C\40\23\11\1E\01\19\36\06\11\C6\00\19\36\86\C3\7C\44
  45 REM E£RND7)2\' ;Q\..)LEN  ;Q\''/\:'% 
  46 REM E£RND7)2\' ;\.'\: )= ;Q\ :)$ ;Q\: ( PAUSE /\:'% 
  47 REM 5\':RND%J%YCOS E£RND7)>\' ;\.'£Q\..7( CLS )%U ;\.'£Q\''7( CLS TAN 
  49 REM \21\86\40\46\2B\05\28\14\4E\79\CB\39\CB\01\91\CB\07\CB\07\CB\07\4E\CB\39\81\77\10\EC\4E\79\CB\39\CB\01\91\11\82\40\12\13\4E\79\CB\3F\CB\3F\CB\39\CB\39\CB\39\CB\01\91\12\13\4E\79\CB\3F\CB\39\CB\39\CB\01\91\12\C9
  50 REM E£RND:/\.'47Q ( CLS 7$4 PRINT TAN E£RND)\:'\'';Q*TAN 
   0 REM "ZX81 LABYRINTH"
   0 REM AXIS SOFTWARE 
  54 CLS 
  55 GOTO 2000
  59 IF B=O THEN GOTO 72
  60 IF B<=V THEN GOTO 63
  61 POKE E,G
  62 RETURN 
  63 POKE 16517,A(A+(B-T)*H)
  64 LET Q=USR 17604
  65 RETURN 
  72 POKE 16514,O
  73 POKE 16515,O
  74 POKE 16516,T
  75 IF A=W THEN POKE E,O
  76 IF PEEK Z<>T AND A=W THEN POKE E,G
  78 RETURN 
  85 IF PEEK E>O THEN GOTO 90
  86 LET B=B+T*(PEEK Z=T)-T*(PEEK Z=3)
  87 LET A=A+T*(PEEK Z=G)-T*(PEEK Z=4)
  88 RETURN 
  90 PRINT AT 10,10;
  91 IF PEEK E=T THEN PRINT "SOLID WALL"
  92 IF PEEK E=G THEN PRINT "NO MANS LAND"
  93 RETURN 
 100 IF Y>V THEN GOTO 5000
 101 LET Q=USR 17697
 102 GOTO 102+3*(INKEY$="G")+8*(INKEY$="L")+18*(INKEY$="R")+48*(INKEY$="F")+28*(INKEY$="B")+33*(INKEY$="H")
 105 CLS 
 107 GOTO 5110
 110 POKE Z,PEEK Z-T
 111 IF PEEK Z=O THEN POKE Z,4
 112 GOTO 185
 120 POKE Z,PEEK Z+T
 121 IF PEEK Z=5 THEN POKE Z,T
 122 GOTO 185
 130 POKE Z,PEEK Z+G
 131 IF PEEK Z>4 THEN POKE Z,PEEK Z-4
 132 GOTO 185
 135 PRINT AT 11,11;"HELP COMING"
 136 GOSUB 6100
 140 GOSUB 4000
 141 PRINT "YOU ARE FACING ";
 142 IF PEEK Z=T THEN PRINT "NORTH"
 143 IF PEEK Z=G THEN PRINT "EAST"
 144 IF PEEK Z=3 THEN PRINT "SOUTH"
 145 IF PEEK Z=4 THEN PRINT "WEST"
 146 PRINT AT (V*G+G)-Y*G,X*G-T;"*"
 147 FOR P=T TO 200
 148 NEXT P
 149 GOTO 185
 150 LET A=X
 155 LET B=Y
 160 GOSUB 59
 165 GOSUB 85
 170 LET X=A
 175 LET Y=B
 180 IF PEEK E>O THEN GOTO 100
 182 LET R$=R$+CHR$ X+CHR$ Y
 185 LET A=X
 190 LET B=Y
 192 LET Q=USR 17680
 195 GOSUB 59
 200 LET Q=USR 16525
 205 IF PEEK E<>O THEN GOTO 100
 210 GOSUB 85
 215 GOSUB 59
 220 IF PEEK E=G THEN GOTO 100
 225 LET Q=USR 16761
 230 IF PEEK E<>O THEN GOTO 100
 235 GOSUB 85
 240 GOSUB 59
 245 IF PEEK E=G THEN GOTO 100
 250 LET Q=USR 17004
 255 IF PEEK E<>O THEN GOTO 100
 260 GOSUB 85
 265 GOSUB 59
 270 IF PEEK E=G THEN GOTO 100
 275 LET Q=USR 17228
 280 IF PEEK E<>O THEN GOTO 100
 285 GOSUB 85
 290 GOSUB 59
 295 IF PEEK E=G THEN GOTO 100
 300 LET Q=USR 17416
 305 IF PEEK E<>O THEN GOTO 100
 310 GOSUB 85
 315 GOSUB 59
 320 IF PEEK E=G THEN GOTO 100
 325 PRINT AT 11,14;"""?"""
 330 GOTO 100
2000 LET Q=USR 17680
2001 PRINT TAB 11;"Z X 8 1";TAB 38;"(C) AXIS SOFTWARE"
2002 PRINT 
2003 PRINT "%   \ .% \.  % % \:. %  %  % % \:. %  %  %  % % %  %  % "
2004 PRINT "%   %  %  %  %  %  %  %  %  %  % \: %   %   %  % "
2005 PRINT "%   % % %  % % \:  \ '% \'  % % \:  %  % \'.%   %   % % % "
2006 PRINT "%   %  %  %  %   %   %  %  %  % \ :%   %   %  % "
2007 PRINT "% %  %  %  % % \:'  %   %  %  %  %  %   %   %  % "
2008 PRINT 
2009 PRINT "    DIMENSIONS OF THE MAZE"
2010 PRINT 
2011 PRINT "ENTER WIDTH ( BETWEEN 3 AND 15 )"
2012 GOSUB 6000
2013 LET O=0
2014 LET T=1
2015 INPUT H$
2016 RAND 
2017 LET G=2
2018 GOTO 2015+10*(H$>"2" AND H$<"A" AND LEN H$=T)+5*(LEN H$=G)
2020 IF H$(T)<>"1" OR H$(G)>"5" OR H$(G)<"0" THEN GOTO 2015
2025 LET H=VAL H$
2030 PRINT 
2035 PRINT "ENTER HEIGHT ( BETWEEN 3 AND 9 )"
2036 GOSUB 6000
2040 INPUT V$
2045 IF V$<"3" OR V$>"9" OR LEN V$<>T THEN GOTO 2040
2050 LET V=VAL V$
2060 PRINT 
2070 PRINT " PLEASE WAIT WHILE I GO AND MAKETHE MAZE"
2080 GOSUB 6100
2090 FAST 
2100 LET A=H*V+T
2102 LET AA=A
2105 LET C=G
2107 LET A$="\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\..\.."
2110 DIM A(A*C)
2111 LET E=16516
2112 LET JJ=O
2115 LET Q=O
2116 LET Z=Q
2120 LET X=INT (RND*H)+T
2121 LET XX=X
2122 LET Y=O
2125 LET A(A)=X
2130 LET A(X)=T
2135 LET R$=CHR$ X+CHR$ Y
2140 LET R=X
2145 LET S=T
2150 GOTO 2220
2160 IF R<H THEN GOTO 2200
2170 IF S<V THEN GOTO 2190
2180 LET R=T
2181 LET S=T
2182 GOTO 2210
2190 LET R=T
2191 LET S=S+T
2192 GOTO 2210
2200 LET R=R+T
2210 IF A(R+(S-T)*H)=O THEN GOTO 2160
2220 IF R-T=O THEN GOTO 2610
2230 IF A(R-T+(S-T)*H)<>O THEN GOTO 2610
2240 IF S-T=O THEN GOTO 2420
2250 IF A(R+(S-G)*H)<>O THEN GOTO 2420
2260 IF R=H THEN GOTO 2320
2270 IF A(R+T+(S-T)*H)<>O THEN GOTO 2320
2280 LET X=INT (RND*3)+T
2290 IF X=T THEN GOTO 2960
2300 IF X=G THEN GOTO 3000
2310 GOTO 3040
2320 IF S<>V THEN GOTO 2350
2330 IF Z=T THEN GOTO 2400
2340 LET Q=T
2345 GOTO 2360
2350 IF A(R+S*H)<>O THEN GOTO 2400
2360 LET X=INT (RND*3)+T
2370 IF X=T THEN GOTO 2960
2380 IF X=G THEN GOTO 3000
2390 GOTO 3110
2400 LET X=INT (RND*G)+T
2410 GOTO 2370
2420 IF R=H THEN GOTO 2540
2430 IF A(R+T+(S-T)*H)<>O THEN GOTO 2540
2440 IF S<>V THEN GOTO 2470
2450 IF Z=T THEN GOTO 2520
2460 LET Q=T
2465 GOTO 2480
2470 IF A(R+S*H)<>O THEN GOTO 2520
2480 LET X=INT (RND*3)+T
2490 IF X=T THEN GOTO 2960
2500 IF X=G THEN GOTO 3040
2510 GOTO 3110
2520 LET X=INT (RND*G)+T
2530 GOTO 2490
2540 IF S<>V THEN GOTO 2570
2550 IF Z=T THEN GOTO 2960
2560 LET Q=T
2565 GOTO 2580
2570 IF A(R+S*H)<>O THEN GOTO 2960
2580 LET X=INT (RND*G)+T
2590 IF X=T THEN GOTO 2960
2600 GOTO 3110
2610 IF S-T=O THEN GOTO 2820
2620 IF A(R+(S-G)*H)<>O THEN GOTO 2820
2630 IF R=H THEN GOTO 2750
2640 IF A(R+T+(S-T)*H)<>O THEN GOTO 2750
2650 IF S<>V THEN GOTO 2680
2660 IF Z=T THEN GOTO 2730
2670 LET Q=T
2675 GOTO 2690
2680 IF A(R+S*H)<>O THEN GOTO 2730
2690 LET X=INT (RND*3)+T
2700 IF X=T THEN GOTO 3000
2710 IF X=G THEN GOTO 3040
2720 GOTO 3110
2730 LET X=INT (RND*G)+T
2740 GOTO 2700
2750 IF S<>V THEN GOTO 2780
2760 IF Z=T THEN GOTO 3000
2770 LET Q=T
2775 GOTO 2790
2780 IF A(R+S*H)<>O THEN GOTO 3000
2790 LET X=INT (RND*G)+T
2800 IF X=T THEN GOTO 3000
2810 GOTO 3110
2820 IF R=H THEN GOTO 2910
2830 IF A(R+T+(S-T)*H)<>O THEN GOTO 2910
2840 IF S<>V THEN GOTO 2870
2850 IF Z=T THEN GOTO 3040
2860 LET Q=T
2865 GOTO 2880
2870 IF A(R+S*H)<>O THEN GOTO 3040
2880 LET X=INT (RND*G)+T
2890 IF X=T THEN GOTO 3040
2900 GOTO 3110
2910 IF S<>V THEN GOTO 2940
2920 IF Z=T THEN GOTO 2160
2930 LET Q=T
2935 GOTO 2950
2940 IF A(R+S*H)<>O THEN GOTO 2160
2950 GOTO 3110
2960 LET A(R-T+(S-T)*H)=C
2970 LET C=C+T
2972 LET A(A+R-T+(S-T)*H)=G
2974 LET R=R-T
2980 IF C=A THEN GOTO 3210
2990 LET Q=O
2995 GOTO 2220
3000 LET A(R+(S-G)*H)=C
3010 LET C=C+T
3020 LET A(A+R+(S-G)*H)=T
3022 LET S=S-T
3024 IF C=A THEN GOTO 3210
3030 LET Q=O
3035 GOTO 2220
3040 LET A(R+T+(S-T)*H)=C
3050 LET C=C+T
3055 IF A(A+R+(S-T)*H)=O THEN GOTO 3070
3060 LET A(A+R+(S-T)*H)=3
3065 GOTO 3080
3070 LET A(A+R+(S-T)*H)=G
3080 LET R=R+T
3090 IF C=A THEN GOTO 3210
3100 GOTO 2610
3110 IF Q=T THEN GOTO 3170
3120 LET A(R+S*H)=C
3122 LET C=C+T
3124 IF A(A+R+(S-T)*H)=O THEN GOTO 3140
3130 LET A(A+R+(S-T)*H)=3
3135 GOTO 3150
3140 LET A(A+R+(S-T)*H)=T
3145 IF R<>H AND RND>.6 THEN LET A(A+R+(S-T)*H)=3
3150 LET S=S+T
3155 IF C=A THEN GOTO 3210
3160 GOTO 2220
3170 LET Z=T
3180 IF A(A+R+(S-T)*H)=O THEN GOTO 3200
3190 LET A(A+R+(S-T)*H)=3
3192 LET Q=O
3194 GOTO 2160
3200 LET A(A+R+(S-T)*H)=T
3202 LET Q=O
3204 LET R=T
3206 GOTO 2210
3210 IF Z<>T THEN LET X=A+INT ((RND*(H-T))+T)+(V-T)*H
3220 IF Z<>T THEN LET A(X)=A(X)+T
3230 CLS 
3235 SLOW 
3240 PRINT 
3245 PRINT "TO MOVE THROUGH THE MAZE TOUCH  THE KEYS LISTED BELOW"
3247 PRINT 
3250 PRINT "  ""F"" - ONE STEP FORWARD"
3252 PRINT "  ""L"" - LOOK LEFT"
3254 PRINT "  ""R"" - LOOK RIGHT"
3256 PRINT "  ""B"" - LOOK BACK"
3258 PRINT "  ""H"" - FOR HELP"
3260 PRINT "  ""G"" - GIVE UP"
3270 PRINT 
3280 PRINT "WOULD YOU LIKE TO SEE THE MAZE  PLAN BEFORE YOU START?"
3282 PRINT 
3285 PRINT "(Y/N)"
3290 INPUT Q$
3295 IF (CODE Q$<>62)+(CODE Q$<>51)<>T THEN GOTO 3290
3300 IF Q$(T)<>"Y" THEN GOTO 3610
3305 GOSUB 6300
3310 GOSUB 4000
3315 LET JJ=O
3320 PRINT AT V*G+G,XX*G-T;"*"
3330 PRINT AT 21,O;"STUDY CAREFULLY"
3340 GOTO 3640
3610 GOSUB 6200
3620 FAST 
3640 FOR I=T TO A-T
3650 LET J=I+A
3660 LET A(I)=(3-A(J))*G
3670 NEXT I
3710 LET W=INT A(A)
3720 FOR J=T TO V
3730 LET K=(J-T)*H
3740 FOR I=T TO H
3750 LET L=I+K
3760 IF J<>T THEN GOTO 3790
3770 IF I=W THEN GOTO 3820
3780 LET M=T
3785 GOTO 3810
3790 LET M=INT (A(L-H)/G)
3800 LET M=M-INT (M/G)*G
3810 LET A(L)=A(L)+M*8
3820 IF I=T THEN LET M=T
3825 IF I=T THEN GOTO 3850
3830 LET M=INT (A(L-T)/4)
3840 LET M=M-INT (M/G)*G
3850 LET A(L)=A(L)+M
3860 NEXT I
3865 IF J=T THEN GOSUB 6200
3870 NEXT J
3875 CLS 
3880 LET X=W
3882 LET Y=O
3884 LET Z=16518
3886 POKE Z,T
3888 SLOW 
3890 GOTO 185
4000 CLS 
4001 FAST 
4003 PRINT 
4005 FOR J=V TO T STEP -T
4010 FOR I=T TO H
4020 IF A(AA+I+(J-T)*H)=O OR A(AA+I+(J-T)*H)=G THEN GOTO 4050
4030 PRINT "%  ";
4040 GOTO 4060
4050 PRINT "% % ";
4060 NEXT I
4070 PRINT "% "
4080 PRINT "% ";
4090 FOR I=T TO H
4100 IF A(AA+I+(J-T)*H)<G THEN GOTO 4130
4110 PRINT "  ";
4120 GOTO 4140
4130 PRINT " % ";
4140 NEXT I
4150 PRINT 
4160 NEXT J
4170 FOR I=T TO H
4180 IF I=A(AA) THEN GOTO 4210
4190 PRINT "% % ";
4200 GOTO 4220
4210 PRINT "%  ";
4220 NEXT I
4230 PRINT "% "
4240 PRINT 
4245 IF Q$(T)="Y" THEN GOTO 4260
4250 LET JJ=JJ+T
4260 SLOW 
4270 LET Q$="N"
4300 RETURN 
5000 CLS 
5010 PRINT 
5020 PRINT A$
5025 PRINT 
5040 PRINT TAB 8;"CONGRATULATIONS"
5045 PRINT 
5050 PRINT "YOU GOT THROUGH THE ";H;" BY ";V;" MAZE"
5052 PRINT "IN ";LEN R$/G-T;" MOVES."
5055 PRINT 
5060 IF JJ=O THEN GOTO 5100
5065 PRINT "BUT YOU ASKED FOR HELP ";
5066 IF JJ<>T THEN PRINT JJ;" TIMES"
5070 IF JJ=T THEN PRINT "ONCE"
5075 PRINT 
5100 PRINT A$
5110 PRINT 
5120 PRINT "DO YOU WANT TO SEE YOUR ROUTE?"
5125 PRINT 
5127 PRINT "(Y/N)"
5130 INPUT P$
5132 IF P$="" THEN GOTO 5130
5135 IF P$(T)="N" THEN GOTO 5240
5138 IF P$(T)="Y" THEN GOTO 5140
5139 GOTO 5130
5140 GOSUB 6300
5150 GOSUB 4000
5160 FOR J=T TO LEN R$ STEP G
5170 LET X=CODE R$(J)*G
5175 LET Y=CODE R$(J+T)*G
5180 PRINT AT V*G+G-Y,X-T;"*"
5185 LET Q=LN EXP T
5190 IF J<LEN R$-G THEN PRINT AT (V*G+G)-Y,X-T;" "
5200 NEXT J
5210 FOR J=T TO 20
5220 NEXT J
5230 CLS 
5240 PRINT 
5300 PRINT "WOULD YOU LIKE ANOTHER GAME?"
5302 PRINT 
5305 PRINT "(Y/N)"
5306 IF P$(T)="N" THEN GOTO 5310
5307 PRINT 
5308 PRINT "OR ANOTHER REPLAY (R)"
5310 INPUT Q$
5320 IF Q$="" THEN GOTO 5310
5330 IF Q$(T)="Y" THEN RUN 
5335 IF Q$(T)="R" THEN GOTO 5140
5337 IF Q$(T)<>"N" THEN GOTO 5310
5340 PRINT 
5350 PRINT "OK, THANKS FOR PLAYING.  BYE"
5380 IF INKEY$="" THEN GOTO 5380
5390 GOTO T
6000 PRINT " AND PRESS NEWLINE" 
6010 PRINT 
6020 RETURN 
6100 FOR K=T TO 20
6110 NEXT K
6120 RETURN 
6200 CLS 
6230 PRINT 
6240 PRINT "PLEASE WAIT WHILE I BUILD UP THEENTRANCE TO THE MAZE"
6250 GOSUB 6100
6255 FAST 
6270 RETURN 
6300 CLS 
6305 PRINT 
6310 PRINT "OK, HOLD ON"
6315 GOSUB 6100
6320 RETURN 
9000 CLEAR 
9010 SAVE "LABYRINT%H"
9020 RUN 

People

No people associated with this content.

Scroll to Top