ЛАБИРИНТ
Через некоторое время после загрузки этой программы на экране появится лабиринт, стенки которого окрашены в белый цвет, а проходы заполнены зелеными звездочками. Цель игры состоит в том, чтобы за минимальное время собрать эти звездочки, передвигая по проходам маленького человечка.
Клавиши управления: Р - вправо; О - влево; Q - вверх;.А - вниз.
Чтобы начать игру, необходимо нажать Enter, а затем одну из клавиш управления. В верхней части лабиринта появится человечек, и начнется отсчет времени - теперь не зевайте!
Программа 39. ЛАБИРИНТ.
9 LET r=1000
10 BORDER 0: INK 7: PAPER 0: CLS : LET d=0: LET y=3:LET x=-1 15 GO SUB 2000: RESTORE
20 FOR i=1 TO 608: READ a
30 IF a=1 THEN PRINT AT y,x+1;"#": GO TO 50
40 INK 5: PRINT AT y,x+1;"*": INK 7
50 LET x=x+1: IF x=31 THEN LET y=y+1: LET x=-1
60 NEXT i: PRINT AT 1,20; INK 3;"Rekord ";r;"nn":PRINT AT 3,13; INK 2; "START": PAUSE 0: BEEP .05,30:PRINT AT 3,13; INVERSE 1;;"#####" 70 LET m=0: LET t=0: LET y=4: LET x=5: LET p=0: LET p1=0 80 PRINT AT y,x;"A" 85 INK 6
90 IF INKEY$="q" THEN GO SUB 500 100 IF INKEY$="a" THEN GO SUB 530 110 IF INKEY$="o" THEN GO SUB 560 120 IF INKEY$="p" THEN GO SUB 600 125 IF p1<p THEN LET p1=p: BEEP .0008,55 130 LET t=t+.5: IF p=304 THEN GO TO 200 140 PRINT AT 1,1; INK 3;"Time ";INT (t) 150 GO TO 85
200 BEEP .2,15: BEEP .2,11: PRINT AT 1,1; INK 3;"TIME";INT (t)
210 IF INT (t)<r THEN PRINT AT 1,19; INK 2;"Rekord ";INT(t);"ПП": LET r=INT (t)
220 INPUT #0;"NEW GAME? (y/n)";o$
230 IF o$="y" OR o$="Y" THEN RESTORE : GO TO 10
240 BEEP .3,10: STOP
500 IF SCREEN$ (y-1,x)="*" THEN LET p=p+1: LET y=y-1:PRINT AT y,x;"A";AT y+1,x;" " 510 IF SCREEN$ (y-1,x)=" " THEN LET y=y-1: PRINT AT y,x;"A";AT y+1,x;" " 520 RETURN
530 IF SCREEN$ (y+1,x)="*" THEN LET p=p+1: LET y=y+1:PRINT AT y,x;"A";AT y-1,x;" " 540 IF SCREEN$ (y+1,X)=" " THEN LET y=y+1: PRINT AT y,x;"A";AT y-1,x;" " 550 RETURN
560 IF SCREEN$ (y,x-1)="*" THEN LET p=p*1: LET x=x-1: PRINT AT y,x;"A";AT y,x+1;" " 570 IF SCREEN$ (y,x-1)=" " THEN LET x=x-1: PRINT AT y,x;"A";AT y,x+1;" " 580 RETURN
600 IF SCREEN$ (y,x+1)="*" THEN LET p=p+1: LET x=x+1:PRINT AT y,x;"A";AT y,x-1;" " 610 IF SCREEN$ (y,X+1)=" " THEN LET x=x+1: PRINT AT y,x;"A";AT y,x-1;" " 620 RETURN
1000 DATA 1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 1010 DATA 1,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,1,0,0,1,0,0,0,0,0,0,0,1 1020 DATA 1,0,1,0,1,1,0,1,1,1,1,0,1,1,0,1,0,1,1,1,0,0,1,0,0,1,0,1,1,1,0,1 1030 DATA 1,0,0,0,1,1,0,0,1,0,0,0,0,1,0,1,0,1,0,1,0,1,1,0,1,1,0,1,0,0,0,1 1040 DATA 1,0,1,0,0,0,1,0,0,0,1,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,1,1,0,1 1050 DATA 1,0,1,1,1,0,0,0,1,0,0,1,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,1,1,0,0,1 1060 DATA 1,0,0,0,1,0,1,1,0,1,0,0,0,1,0,0,0,1,0,1,1,0,1,0,1,1,1,0,0,0,1,1
1070 DATA 1,0,1,0,0,0,0,0,0,0,0,1,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,1 1080 DATA 1,0,1,0,1,0,1,1,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