0% found this document useful (0 votes)
5 views1 page

Basic Computer Gamesamazing

The document describes a BASIC program that generates a unique maze each time it is executed, allowing users to specify the maze's dimensions. The program ensures there is only one path through the maze and includes error handling for invalid dimensions. It was originally authored by Jack Hauber from Windsor, Connecticut.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views1 page

Basic Computer Gamesamazing

The document describes a BASIC program that generates a unique maze each time it is executed, allowing users to specify the maze's dimensions. The program ensures there is only one path through the maze and includes error handling for invalid dimensions. It was originally authored by Jack Hauber from Windsor, Connecticut.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

Amazing

10 PRINT TAB(28);"AMAZING PROGRAM”


This program will print outa different
20 PRINT TAB(15);"CREATIVE COMPUTING NORRISTOWN, NEW JERSEY”
maze every time it is run and 30 PRINT:PRINTsPRINT SPRINT
guarantees only one path through. You 100 INPUT “WHAT ARE YOUR WIDTH AND LENGTH";H,V
can choose the dimensions of the maze TF HC>1 AND V<>1 THEN 110
PRINT “MEANINGLESS DIMENSIONS. TRY AGAIN.":GOTO 100
— i.e. the number of squares wide and DIM U(H,V),VCH,Y)
long. PRINT
The original program author was PRINT
Jack Hauber of Windsor, Connecticut. PRINT
PRINT
Q=0:Z=O03X=INT(RND(1)¢H+1)
FOR I=i TO H
IF =X THEN 173
PRINT “.--"3:G0TO 180
PRINT “. “3
NEXT I 60TO 820
PRINT ".% IF R=H THEN 740
C=1sU(X,1)2C2CaC+) IF W(Rt1,5)<>0 THEN 740
R=X25=1260TO 260 IF S<>V THEN 700
IF R<>H THEN 240 IF Z=1 THEN 730
IF SQV THEN 230 Q=1:G60T0 830
R=1:5=1:60T0 250 IF U(R,S41)<>0 THEN 730
AMAZING PROGRAN
R21:5=S+1:GOTO 250 X=INT(RND(1)#2+1)
CREATIVE COMPUTING MORRISTOWN, NEW JERSEY
R=Rt1 ON X GOTO 860,910
IF W(R,S)=0 THEN 210 60TO 860
IF R-1=0 THEN 530 IF S<>V THEN 760
IF U(R-1,5)<>0 THEN 530 IF Z=1 THEN 780
IF $-1=0 THEN 390 Q=1:60T0 770
IF W(R,S-1)<20 THEN 390 IF U(R,S+1)<>0 THEN 780
WHAT ARE YOUR WIDTH AND LENGTH? 15,20 IF R=H THEN 330 GOTO 910
IF U(R+1,S)<>0 THEN 330 GOTO 1000
XeINT(RND(1) #341) W(R-1,S5)=C
ON X GOTO 790,820,860 C=C+1:V(R-1,5)=2:R=R-1
IF SV THEN 340 IF C=H8V+1 THEN 1010
IF Z=1 THEN 370 Q=0:60T0 260
ey I I ek I Q=1:G0T0 350 WR, 8-1)=C
Q ff feeg §ees=so 1 Rose Sa oc IF W(R,S+1)<>0 THEN 370 c=C+1
I eet I as sy at 3 X=INT(RND(1) #341) V(R,S-1)=1:S=S-1sIFC=H#V+1 THEN 1010
ce" GO fh 6eshecises Bb testes 1 0° o ON X GOTO 790,820,910 0=0:G0T0 260
1 i 4 I I I br gy at} XEINT(RND(1) #241) U(R+1,S)=C
G 0720 ie DRSa ReCHoSfSSHoeg. OSES! 6 ON X GOTO 790,820 C=C+izIF V(R,S)=0 THEN 880
1 bu I yh teat IF R=H THEN 470 V(R,$)=3:60T0 890
GPmey PRS GO “ESCHS
SHRSt) te GERGSCH eo IF W(R#1,S)<>0 THEN 470 V(R,S)=2
I I bo) ro fet IF SQV THEN 420 R=Rt1
BRSHE=GSHE=3F6R) 4 RES SGeSHeSGSSo-Sh ic IF Z=1 THEN 450 IF C=HeV+1 THEN 1010
I I I I le is! Q=1:G0TO 430 GOTO 530
A ODESE) 2 fS OSSRRSH eo) SOR OSS fo ts IF W(R,S+1)<20 THEN 450 IF Q=1 THEN 940
I Ie led it ow I I I X=INT(RND(1) #341) W(R, S41 )=C2C=C+1F1F V(R,S)=0 THEN 940
G-e0 @ GEER TeSdeeo Geeta greg Be apop ON X GOTO 790,840,910 V(R,S)=3:G0T0 950
I lanl I I I eu I X=INT(RND(1) #241) V(R,S)=1
9 PSR GG ORB GO IG TR Gh Besa 65 ON X GOTO 790,860 S=S+1:IF C=H#V+1 THEN 1010
Let coe I Dele k Le IF SCV THEN 490 60T0 260
| BSR BRS of) GSS Gee Seay oe os IF Z=1 THEN 520 960 171
Boe! th od I 1 tet Q=1:G0T0 500 970 IF V(R,S)©0 THEN 980
Seton = “3 8 8 4B 2G 86S Geet) IF W(R,S+1)<>0 THEN 520 975 V(R,S)=32020:GOTO 1000
I I Ie ih Bo fu I 1 I X=INT(RND(1) 8241) 980 V(R,5)=1:Q=02R=1:521:G0T0 250
JPSGES0 Be 0) Hes0h De DS SS ye UES ON X GOTO 790,910 1000 60TO 210
I Lae Hn) OFadBelay i I 60TO 790 1010 FOR J=1 TO V
9 (0220) SGEeOSS0) 20r DP Seb SSG a0) SHES 5 IF S-1=0 THEN 470 1011 PRINT “I"3
1 I I lens I bok
IF W(R,S-1)<>0 THEN 670 1012 FOR I=1 TO H
@ RESHS°R Ro RABSoH 9G DeaRcet SSH iby og IF R=H THEN 610 1013 IF V(1,J)<2 THEN 1030
I Lal I Mh Ls I I
IF W(R+1,5)<>0 THEN 410 1020 PRINT “3
Respecg? GS20Esa Gr eeu OG BESS Qe S0e=h IF S<>V THEN 560 1021 G0TO 1040
I Lied I I I I I IF Z21 THEN 590 1030 PRINT "I";
0. BB @ GEST SSHeS tp FEST 1. AO: Sete on Q=1:60T0 570 1040 NEXT I
iT I I I | a fe 16 ut
IF W(R,S+1)<>0 THEN 590 1041 PRINT
B Beepccnesy 3 OG EeGeSHESo 98 Dy i Gan XEINT(RND(1) 0341) 1043 FOR I=1 TO H
Il I I Md I I
ON X GOTO 820,860,910 1045 IF V(I,J)20 THEN 10460
4 @-@ HES SOSS02 AESGSSh: PS SHSSES isso X=INT(RND(1)#2+1) 1050 IF V(I,J)#2 THEN 10460
iy I I I 1i | ON X GOTO 820,860 1051 PRINT “s “3
S (GR DeOSS0S=0=
SNC Soe ieSh ie BseU=S 0 ic IF S<>V THEN 630 1052 GOTO 1070
1 hae 1 I I I IF Z=1 THEN 660 1060 PRINT “3--";
9) GG B65 -fe-Aoan 4 Oh ES TRe “uate Q=1:G0TO 440 1070 NEXT I
ee I I I I IF W(R,S+1)<>0 THEN 660 1071 PRINT "."
BaP RISO Sede Sap Sote =f =e 3 =Sh e290. HeSioas XEINT(RND(1) #241) 1072 NEXT J
oK
ON X GOTO 820,910 1073 END

You might also like