Mister_Alex
Experienced Member
- Joined
- Sep 1, 2011
- Messages
- 58
Sorry it took so long to get back to everyone. Here's the code I am currently using for that random maze generator:
5 text : home
10 print "Amazing Program"
20 print "Creative Computing"
30 print : print : print : print
100 input "WHAT ARE YOUR DIMENSIONS?";h,v
102 if h<>1 and v<>1 then 110
104 print "MEANINGLESS. TRY AGAIN" : goto 100
110 dim w(h,v) : dim p(h,v)
120 print
130 print
140 print
150 print
160 x=0 : z=0 : x=int(rnd(1)*h+1)
165 for i=1 to h
170 if i=x then 173
171 print ".--"; : goto 180
173 print ". ";
180 next i
190 print "."
195 c=1 : w(x,1)=c : c=c+1
200 r=x : s=1 : goto 260
210 if r<>h then 260
215 if s<>v then 230
220 r=1 : s=1 : goto 250
230 r=1 : s=s+1 : goto 250
240 r=r+1
250 if w(r-1,s)<>0 then 210
260 if r-1=0 then 530
265 if w(r-1,s)<>0 then 530
270 if s-1=0 then 390
280 if w(r,s-1)<>0 then 390
290 if r=h then 330
300 if w(r+1,s)<>0 then 330
310 if r=h then 350
320 if w(r+1,s)<>0 then 350
330 x=rnd(3)
340 on x goto 940,980,1020
350 if s<>v then 380
360 if z=1 then 410
370 q=1 : goto 390
380 if w(r,s+1)<>0 then 410
390 x=rnd(3)
400 on x goto 940,980,1090
410 x=rnd(2)
420 on x goto 940,980
430 if r=h then 530
440 if w(r+1,s)<>0 then 530
450 if s<>v then 480
460 if z=1 then 510
470 q=1 : goto 490
480 if w(r,s+1)<>0 then 510
490 x=rnd(3)
500 on x goto 940,1020,1090
510 x=rnd(2)
520 on x goto 940,1020
530 if s<>v then 560
540 if z=1 then 590
550 q=1 : goto 570
560 if w(r,s+1)<>0 then 590
570 x=int(rnd(0)*2+1)
580 on x goto 940,1090
590 goto 940
600 if s-1=0 then 790
610 if w(r,s-1)<>0 then 790
620 if r=h then 720
630 if w(r+1,s)<>0 then 720
640 if s<>v then 670
650 if z=1 then 700
660 q=1 : goto 680
670 if w(r,s+1)<>0 then 700
680 x=rnd(3)
690 on x goto 900,1020,1090
700 x=rnd(2)
710 on x goto 980,1020,1090
720 x=rnd(2)
730 if z=1 then 780
740 q=1 : goto 760
750 if w(r,s+1)<>0 then 780
760 x=rnd(2)
770 on x goto 980,1090
780 goto 980
790 if r=h then 800
800 if w(r+1,s)<>0 then 880
810 if s<>v then 840
820 if z=1 then 870
830 q=1 : goto 990
840 if w(r,s+1)<>0 then 870
850 x=rnd(2)
860 on x goto 1020,1090
870 goto 1020
880 if s<>v then 910
890 if z=1 then 930
900 q=1 : goto 920
910 if w(r,s+1)<>0 then 930
920 goto 1090
930 goto 1190
940 w(r-1,s)=c
950 c=c+1 : p(r-1,5)=2 : r=r-1
960 if c=h*v+1 then 1280
970 q=0 : goto 270
980 w(r,s-1)=c
990 c=c+1
1000 p(r,s-1)=1 : s=s-1 : if c=h*v+1 then 1200
1010 q=0 : goto 270
1020 w(r+1,s)=c
1030 c=c+1 : if p(r,s)=0 then 1050
1040 p(r,s)=3 : goto 1060
1050 p(r,s)=2
1060 r=r+1
1070 if c=h*v+1 then 1200
1080 goto 600
1090 if q=1 then 1150
1100 w(r,s+1)=c : c=c+1 : if p(r,s)=0 then 1120
1120 p(r,s)=1
1130 s=s+1 : if c=v*h+1 then 1200
1140 goto 270
1150 z=1
1160 if p(r,s)=0 then 1180
1170 p(r,s)=3 : q=0 : goto 1190
1180 p(r,s)=1 : q=0 : r=1 : s=1 : goto 260
1190 goto 210
1200 for j=1 to v
1210 print "i";
1220 for I=1 to h
1230 if p(i,j)<2 then 1260
1240 print " ";
1250 goto 1270
1260 print " I";
1270 next I
1280 print " "
1290 for I=1 to h
1300 if p(i,j)=0 then 1340
1310 if v(i,j)=2 then 1340
1320 print ": ";
1330 goto 1350
1340 print ";--";
1350 next I
1360 print ";"
1370 next j
1380 end
It prints the first row flawlessly, but after that it returns an illegal quantity in line 940. Did I make a typo or something?
5 text : home
10 print "Amazing Program"
20 print "Creative Computing"
30 print : print : print : print
100 input "WHAT ARE YOUR DIMENSIONS?";h,v
102 if h<>1 and v<>1 then 110
104 print "MEANINGLESS. TRY AGAIN" : goto 100
110 dim w(h,v) : dim p(h,v)
120 print
130 print
140 print
150 print
160 x=0 : z=0 : x=int(rnd(1)*h+1)
165 for i=1 to h
170 if i=x then 173
171 print ".--"; : goto 180
173 print ". ";
180 next i
190 print "."
195 c=1 : w(x,1)=c : c=c+1
200 r=x : s=1 : goto 260
210 if r<>h then 260
215 if s<>v then 230
220 r=1 : s=1 : goto 250
230 r=1 : s=s+1 : goto 250
240 r=r+1
250 if w(r-1,s)<>0 then 210
260 if r-1=0 then 530
265 if w(r-1,s)<>0 then 530
270 if s-1=0 then 390
280 if w(r,s-1)<>0 then 390
290 if r=h then 330
300 if w(r+1,s)<>0 then 330
310 if r=h then 350
320 if w(r+1,s)<>0 then 350
330 x=rnd(3)
340 on x goto 940,980,1020
350 if s<>v then 380
360 if z=1 then 410
370 q=1 : goto 390
380 if w(r,s+1)<>0 then 410
390 x=rnd(3)
400 on x goto 940,980,1090
410 x=rnd(2)
420 on x goto 940,980
430 if r=h then 530
440 if w(r+1,s)<>0 then 530
450 if s<>v then 480
460 if z=1 then 510
470 q=1 : goto 490
480 if w(r,s+1)<>0 then 510
490 x=rnd(3)
500 on x goto 940,1020,1090
510 x=rnd(2)
520 on x goto 940,1020
530 if s<>v then 560
540 if z=1 then 590
550 q=1 : goto 570
560 if w(r,s+1)<>0 then 590
570 x=int(rnd(0)*2+1)
580 on x goto 940,1090
590 goto 940
600 if s-1=0 then 790
610 if w(r,s-1)<>0 then 790
620 if r=h then 720
630 if w(r+1,s)<>0 then 720
640 if s<>v then 670
650 if z=1 then 700
660 q=1 : goto 680
670 if w(r,s+1)<>0 then 700
680 x=rnd(3)
690 on x goto 900,1020,1090
700 x=rnd(2)
710 on x goto 980,1020,1090
720 x=rnd(2)
730 if z=1 then 780
740 q=1 : goto 760
750 if w(r,s+1)<>0 then 780
760 x=rnd(2)
770 on x goto 980,1090
780 goto 980
790 if r=h then 800
800 if w(r+1,s)<>0 then 880
810 if s<>v then 840
820 if z=1 then 870
830 q=1 : goto 990
840 if w(r,s+1)<>0 then 870
850 x=rnd(2)
860 on x goto 1020,1090
870 goto 1020
880 if s<>v then 910
890 if z=1 then 930
900 q=1 : goto 920
910 if w(r,s+1)<>0 then 930
920 goto 1090
930 goto 1190
940 w(r-1,s)=c
950 c=c+1 : p(r-1,5)=2 : r=r-1
960 if c=h*v+1 then 1280
970 q=0 : goto 270
980 w(r,s-1)=c
990 c=c+1
1000 p(r,s-1)=1 : s=s-1 : if c=h*v+1 then 1200
1010 q=0 : goto 270
1020 w(r+1,s)=c
1030 c=c+1 : if p(r,s)=0 then 1050
1040 p(r,s)=3 : goto 1060
1050 p(r,s)=2
1060 r=r+1
1070 if c=h*v+1 then 1200
1080 goto 600
1090 if q=1 then 1150
1100 w(r,s+1)=c : c=c+1 : if p(r,s)=0 then 1120
1120 p(r,s)=1
1130 s=s+1 : if c=v*h+1 then 1200
1140 goto 270
1150 z=1
1160 if p(r,s)=0 then 1180
1170 p(r,s)=3 : q=0 : goto 1190
1180 p(r,s)=1 : q=0 : r=1 : s=1 : goto 260
1190 goto 210
1200 for j=1 to v
1210 print "i";
1220 for I=1 to h
1230 if p(i,j)<2 then 1260
1240 print " ";
1250 goto 1270
1260 print " I";
1270 next I
1280 print " "
1290 for I=1 to h
1300 if p(i,j)=0 then 1340
1310 if v(i,j)=2 then 1340
1320 print ": ";
1330 goto 1350
1340 print ";--";
1350 next I
1360 print ";"
1370 next j
1380 end
It prints the first row flawlessly, but after that it returns an illegal quantity in line 940. Did I make a typo or something?