'=========================================================================== ' Subject: LABYRINTH-ORIENTEERING Date: 05-04-96 (12:00) ' Author: Jarkko Ryyppo Code: QB, QBasic, PDS ' Origin: www.lut.fi/~jtryyppo/ Packet: GRAPHICS.ABC '=========================================================================== REM ******************************************************** REM * LABY-O J.Ryyppo -94 * ** REM * m and n =map * **** REM * , =left turn * ****** REM * . =right turn * ********* REM * SPACE =move * *********** REM * Start qbasic /run laby.txt ************** REM ******************************************************** SCREEN 0: GOTO 1300 99 CLEAR , , 1650 DIM m$(75, 40), N$(3, 5), pe$(19), tos(19, 6), tyh(19), jr%(19), jro%(19) KEY 15, CHR$(0) + CHR$(51): KEY 16, CHR$(0) + CHR$(52): KEY 17, CHR$(0) + CHR$(57): KEY 18, CHR$(0) + CHR$(50): KEY 19, CHR$(0) + CHR$(1) ON KEY(15) GOSUB 14: ON KEY(16) GOSUB 15: ON KEY(17) GOSUB 17: ON KEY(18) GOSUB 10: ON KEY(19) GOSUB 350 KEY(19) ON ON ERROR GOTO Virheet GOSUB 1200 vnk = INT((.93 + tapu / 1.32 * .07) * 100) / 100: IF vnk < 1 THEN vnk = 1 REM vk = .6 CLS : v$ = "y" LOCATE 1, 1 PRINT PRINT " LABYRINTH-O (ver. 2.20) " PRINT " ^^^^^^^^^^^ " PRINT " ********************************" PRINT " * Press Caps- and NumLock OFF *" PRINT " ********************************" PRINT PRINT " Control: , = LEFT" PRINT " . = RIGHT" PRINT " SPACE BAR = MOVE" PRINT " m = MAP ON" PRINT " n = MAP OFF" PRINT " Press 'Esc' to drop out or exit" PRINT PRINT " If you select 1 player and 1 event you" PRINT " can choose the number of the course and " PRINT " run the same course in several computers" PRINT " simultaneously." PRINT 71 INPUT " How many players (1-6, 0=demo) "; pe: pe = INT(pe): IF pe > 6 OR pe < 0 THEN 71 IF pe = 0 THEN RUN FOR i = 1 TO pe: PRINT " Player "; i; " (name) "; : INPUT pe$(i - 1): NEXT 72 INPUT " How many events (1-6)"; osat: osat = INT(osat): IF osat > 6 OR osat < 1 THEN 72 GOSUB 500 IF pe = 1 AND osat = 1 THEN PRINT " Select the number of the course ": INPUT " ('0' = random) "; ra FOR qg = 1 TO osat SCREEN 12: CLS : PRINT : PRINT " "; qg; ". EVENT": PRINT IF ra = 0 THEN PRINT " Press 'n'" IF ra = 0 THEN WHILE INKEY$ <> CHR$(110): pp = pp + 1: WEND PRINT PRINT " Wait please... " IF ra = 0 THEN RANDOMIZE TIMER: ELSE : RANDOMIZE ra b$ = CHR$(219): l = 0 FOR x = 0 TO 75: FOR y = 0 TO 40: m$(x, y) = b$: NEXT: NEXT x = INT(RND * 47) + 3 y = INT(RND * 14) + 3 m$(x, y) = " " 1 x = INT(RND * 67) + 3 y = INT(RND * 24) + 3 IF m$(x, y) = " " THEN GOTO 1 REM IF m$(x - 1, y) <> " " AND m$(x, y - 1) <> " " AND m$(x + 1, y) <> " " AND m$(x, y + 1) <> " " THEN 1 IF m$(x - 1, y) = " " AND m$(x - 1, y - 1) = " " AND m$(x, y - 1) = " " THEN 1 IF m$(x, y - 1) = " " AND m$(x + 1, y - 1) = " " AND m$(x + 1, y) = " " THEN 1 IF m$(x + 1, y) = " " AND m$(x + 1, y + 1) = " " AND m$(x, y + 1) = " " THEN 1 IF m$(x, y + 1) = " " AND m$(x - 1, y + 1) = " " AND m$(x - 1, y) = " " THEN 1 m$(x, y) = " ": l = l + 1: IF l > 67 * 24 / 1.85 THEN 2 GOTO 1 2 FOR x = 3 TO 69: FOR y = 3 TO 26 IF m$(x, y) = " " THEN GOTO 3 REM IF m$(x - 1, y) <> " " AND m$(x, y - 1) <> " " AND m$(x + 1, y) <> " " AND m$(x, y + 1) <> " " THEN 3 IF m$(x - 1, y) = " " AND m$(x - 1, y - 1) = " " AND m$(x, y - 1) = " " THEN 3 IF m$(x, y - 1) = " " AND m$(x + 1, y - 1) = " " AND m$(x + 1, y) = " " THEN 3 IF m$(x + 1, y) = " " AND m$(x + 1, y + 1) = " " AND m$(x, y + 1) = " " THEN 3 IF m$(x, y + 1) = " " AND m$(x - 1, y + 1) = " " AND m$(x - 1, y) = " " THEN 3 m$(x, y) = " ": l = l + 1 3 NEXT: NEXT FOR x = 3 TO 69: FOR y = 3 TO 26 IF m$(x, y) <> " " THEN GOTO 4 IF m$(x - 1, y) <> " " AND m$(x, y - 1) <> " " AND m$(x + 1, y) <> " " AND m$(x, y + 1) <> " " THEN m$(x, y) = CHR$(219) 4 NEXT: NEXT IF ra = 0 THEN RANDOMIZE TIMER + pp 5 x1 = INT(RND * 67) + 3 y1 = INT(RND * 24) + 3 IF m$(x1, y1) <> " " THEN 5 m$(x1, y1) = "m" 6 k = 0: x2 = INT(RND * 67) + 3 y2 = INT(RND * 24) + 3 IF m$(x2, y2) <> " " OR ABS(x1 - x2) + ABS(y1 - y2) < 7 THEN 6 m$(x2, y2) = "3" 7 x3 = INT(RND * 67) + 3 y3 = INT(RND * 24) + 3 IF ABS(x1 - x3) + ABS(y1 - y3) < puoli * .6 OR ABS(x2 - x3) + ABS(y2 - y3) < 7 OR m$(x3, y3) <> " " THEN 7 IF ABS(x1 - x2) + ABS(y1 - y2) + ABS(x2 - x3) + ABS(y2 - y3) > 1.2 * puoli THEN m$(x2, y2) = " ": GOTO 6 m$(x3, y3) = "2" 8 x4 = INT(RND * 67) + 3 y4 = INT(RND * 24) + 3 IF m$(x4, y4) <> " " OR ABS(x4 - x2) + ABS(y4 - y2) < puoli * .6 OR ABS(x3 - x4) + ABS(y3 - y4) < 7 OR ABS(x1 - x4) + ABS(y1 - y4) < 16 THEN 8 m$(x4, y4) = "1" 9 x = INT(RND * 67) + 3: o = x y = INT(RND * 24) + 3: p = y IF ABS(x - x3) + ABS(y - y3) < puoli * .6 OR m$(x, y) <> " " OR ABS(x - x4) + ABS(y - y4) < 7 OR ABS(x - x2) + ABS(y - y2) < 16 THEN 9 m$(x, y) = "s" s = INT(RND * 4) + 1: u = s pit = ABS(x1 - x2) + ABS(x2 - x3) + ABS(x3 - x4) + ABS(x4 - x) + ABS(y1 - y2) + ABS(y2 - y3) + ABS(y3 - y4) + ABS(y4 - y) k = k + 1 IF k < 20 AND (pit < 2 * puoli OR pit > 2.6 * puoli) THEN m$(x4, y4) = " ": m$(x, y) = " ": GOTO 8 IF pit < 2 * puoli OR pit > 2.6 * puoli THEN m$(x4, y4) = " ": m$(x3, y3) = " ": m$(x2, y2) = " ": m$(x, y) = " ": GOTO 6 FOR tk = 1 TO 30 RESTORE: k = INT(RND * 51 + 1): FOR i = 1 TO k: READ tx$: NEXT 31 i = INT(RND * 67) + 3: j = INT(RND * 24) + 3 IF m$(i, j) = " " AND VAL(m$(i, j + 1) + "1") + VAL(m$(i, j - 1) + "1") + VAL(m$(i + 1, j) + "1") + VAL(m$(i - 1, j) + "1") = 3 THEN koe = LEN(tx$): koe = (50 - koe) / 2: FOR k = 1 TO koe: koe$ = koe$ + " ": NEXT: m$(i, j) = m$(i, j) + koe$ + tx$: koe$ = "": ELSE GOTO 31 NEXT tk IF s = 1 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x - 1 + i, y - 3 + j): NEXT: NEXT IF s = 3 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x + 3 - j, y - 1 + i): NEXT: NEXT IF s = 2 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x + 1 - i, y + 3 - j): NEXT: NEXT IF s = 4 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x - 3 + j, y + 1 - i): NEXT: NEXT 33 FOR qp = 0 TO pe - 1 CLS : rtt$ = "" PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" PRINT "XX Labyrinth-O --------- A new way to improve your O skills ----------------XX" PRINT "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX" : PRINT : PRINT : PRINT : PRINT " Course is ready ." PRINT : PRINT " "; pe$(qp); "'s turn" INPUT " Do you want to chance settings (y/n) "; r$: IF r$ = "y" THEN GOSUB 550 PRINT " !!!!!!!!!!!!!!!! Put NumLock and CapsLock off! !!!!!!!!!!!!!" PRINT : PRINT : PRINT PRINT " Ready for start." PRINT : PRINT PRINT " Press 'n' " WHILE INKEY$ = CHR$(110) WEND WHILE INKEY$ <> CHR$(110) WEND IF kl$ <> "y" THEN 34 scale$ = "C": scale2$ = "G" PLAY "T50" PLAY "L7" PLAY "O" + STR$(5) FOR a = 1 TO 5: PLAY "X" + VARPTR$(scale$): NEXT PLAY "L4" PLAY "X" + VARPTR$(scale2$) 34 SCREEN 12: GOSUB 16: GOTO 11 10 CLS : KEY(15) OFF: KEY(16) OFF: KEY(17) OFF: KEY(18) OFF WHILE INKEY$ = CHR$(110) WEND mm = mm + 1: tapu = TIMER: COLOR 7: rtt$ = rtt$ + "p" IF g = 1 THEN h$ = m$(x, y): m$(x, y) = "X" FOR j = 2 TO 27: PRINT : FOR i = 2 TO 70 PRINT LEFT$(m$(i, j), 1); NEXT: NEXT IF g = 1 THEN m$(x, y) = h$ LINE (4 + (x1 - 2) * 8, 8 + (y1 - 1) * 16)-(4 + (x2 - 2) * 8, 8 + (y2 - 1) * 16) LINE (4 + (x2 - 2) * 8, 8 + (y2 - 1) * 16)-(4 + (x3 - 2) * 8, 8 + (y3 - 1) * 16) LINE (4 + (x3 - 2) * 8, 8 + (y3 - 1) * 16)-(4 + (x4 - 2) * 8, 8 + (y4 - 1) * 16) LINE (4 + (x4 - 2) * 8, 8 + (y4 - 1) * 16)-(4 + (o - 2) * 8, 8 + (p - 1) * 16) PRINT : PRINT " Paina 'n'" WHILE INKEY$ <> CHR$(110) AND EN = 0 WEND tm = tm + TIMER - tapu: COLOR 7 KEY(15) ON: KEY(16) ON: KEY(17) ON: KEY(18) ON GOSUB 20 RETURN 11 REM 12 REM KEY(15) ON: KEY(16) ON: KEY(17) ON: KEY(18) ON t1 = TIMER 13 IF EN = 1 THEN KEY(15) OFF: KEY(16) OFF: KEY(17) OFF: KEY(18) OFF: GOTO 200 IF EN = 2 THEN KEY(15) OFF: KEY(16) OFF: KEY(17) OFF: KEY(18) OFF: IF ml$ = "y" THEN scale2$ = "G": PLAY "T50": PLAY "L7": PLAY "O" + STR$(5): PLAY "X" + VARPTR$(scale2$): GOTO 200: ELSE : GOTO 200 GOTO 13 14 s = s - 1: GOTO 16 15 s = s + 1 16 IF s = 0 THEN s = 4 IF s = 5 THEN s = 1 IF s = 1 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x - 1 + i, y - 3 + j): NEXT: NEXT: GOSUB 20 IF s = 2 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x + 3 - j, y - 1 + i): NEXT: NEXT: GOSUB 20 IF s = 3 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x + 1 - i, y + 3 - j): NEXT: NEXT: GOSUB 20 IF s = 4 THEN FOR j = 0 TO 3: FOR i = 0 TO 2: N$(i, j) = m$(x - 3 + j, y + 1 - i): NEXT: NEXT: GOSUB 20 RETURN 17 kpapu = kpit IF s = 1 AND m$(x, y - 1) <> b$ THEN y = y - 1: kpit = kpit + 1: rtt$ = rtt$ + "1" IF s = 2 AND m$(x + 1, y) <> b$ THEN x = x + 1: kpit = kpit + 1: rtt$ = rtt$ + "2" IF s = 3 AND m$(x, y + 1) <> b$ THEN y = y + 1: kpit = kpit + 1: rtt$ = rtt$ + "3" IF s = 4 AND m$(x - 1, y) <> b$ THEN x = x - 1: kpit = kpit + 1: rtt$ = rtt$ + "4" IF kpapu = kpit THEN RETURN GOTO 16 200 ERASE N$ IF EN = 1 THEN PRINT "You dropped out!": GOTO 210 ELSE : PRINT "Great! You made it!" LOCATE 4, 1: PRINT "Times control by control:" PRINT " You Previous" vam1 = INT((t2 - t1) / 60): vas1 = INT((t2 - t1 - 60 * INT((t2 - t1) / 60)) * 100) / 100: rvm1 = INT((t2 - t1) / 60): rvs1 = INT(t2 - t1 - 60 * INT((t2 - t1) / 60)) vam2 = INT((t3 - t1) / 60): vas2 = INT((t3 - t1 - 60 * INT((t3 - t1) / 60)) * 100) / 100: rvm2 = INT((t3 - t2) / 60): rvs2 = INT(t3 - t2 - 60 * INT((t3 - t2) / 60)) vam3 = INT((t4 - t1) / 60): vas3 = INT((t4 - t1 - 60 * INT((t4 - t1) / 60)) * 100) / 100: rvm3 = INT((t4 - t3) / 60): rvs3 = INT(t4 - t3 - 60 * INT((t4 - t3) / 60)) vam4 = INT((t5 - t1) / 60): vas4 = INT((t5 - t1 - 60 * INT((t5 - t1) / 60)) * 100) / 100: rvm4 = INT((t5 - t4) / 60): rvs4 = INT(t5 - t4 - 60 * INT((t5 - t4) / 60)) PRINT "1."; vam1; ":"; vas1, rvm1; ":"; rvs1; " ": IF uusi = 1 THEN LOCATE 6, 37: PRINT vm1; ":"; vs1, rm1; ":"; rs1 PRINT "2."; vam2; ":"; vas2, rvm2; ":"; rvs2; " ": IF uusi = 1 THEN LOCATE 7, 37: PRINT vm2; ":"; vs2, rm2; ":"; rs2 PRINT "3."; vam3; ":"; vas3, rvm3; ":"; rvs3; " ": IF uusi = 1 THEN LOCATE 8, 37: PRINT vm3; ":"; vs3, rm3; ":"; rs3 PRINT "m."; vam4; ":"; vas4, rvm4; ":"; rvs4; " ": IF uusi = 1 THEN LOCATE 9, 37: PRINT vm4; ":"; vs4, rm4; ":"; rs4 PRINT : IF kpit = 0 THEN 210 PRINT "Theoretic distance: "; pit; " blocks" PRINT "You travelled "; kpit; " blocks" PRINT " ("; INT(100 * (kpit - pit) / pit * 10) / 10; " % more)" ev1 = INT((t5 - t1) / pit * 100 / 60): ev2 = INT(((t5 - t1) * 100 / pit - 60 * INT((t5 - t1) * 100 / pit / 60)) * 100) / 100 PRINT "Your avarage speed: "; ev1; ":"; ev2; " (min:sec / 100 blocks)" PRINT "You looked at the map "; INT(tm * 100) / 100; " seconds ("; mm; " times)" IF pit > 0 THEN PRINT " "; INT(mm / pit * 1000) / 10; " (times / 100 blocks)" IF mm > 0 THEN PRINT " "; INT(kpit / mm * 10) / 10; " (blocks/ one look)" PRINT " "; INT(tm / (t5 - t1) * 1000) / 10; "% (looking time/finishing time)" 210 INPUT "Do you want to see your route ? (y/n) "; r$: IF r$ = "y" THEN GOSUB 400: GOTO 200 rtt$ = "" tos(qp, qg) = 60 * vam4 + vas4 IF EN = 1 THEN tos(qp, qg) = 3600 tyh(qp) = tyh(qp) + tos(qp, qg) EN = 0 tm = 0: mm = 0: vm1 = vam1: vm2 = vam2: vm3 = vam3: vm4 = vam4: vs1 = vas1: vs2 = vas2: vs3 = vas3: vs4 = vas4 rm1 = rvm1: rm2 = rvm2: rm3 = rvm3: rm4 = rvm4: rs1 = rvs1: rs2 = rvs2: rs3 = rvs3: rs4 = rvs4: kpt = kpit eve1 = ev1: eve2 = ev2: q = 0: x = o: y = p: s = u: kpit = 0 NEXT qp IF pe > 1 OR osat > 1 THEN ERASE m$ IF uusi = 1 THEN 75 GOSUB 1000 NEXT qg 75 IF pe = 1 AND osat = 1 THEN INPUT "Same course gain? (y/n) "; r$: IF r$ = "y" OR r$ = "" THEN uusi = 1: tm = 0: mm = 0: vm1 = vam1: vm2 = vam2: vm3 = vam3: vm4 = vam4: vs1 = vas1: vs2 = vas2: vs3 = vas3: vs4 = vas4: rm1 = rvm1: rm2 = rvm2: rm3 = rvm3: rm4 = rvm4: rs1 = rvs1: rs2 = rvs2: rs3 = rvs3: rs4 = rvs4: kpt = kpit: eve1 = ev1: eve2 = ev2: q = 0: x = o: y = p: s = u: kpit = 0: GOTO 33 INPUT "New competition ? (y/n)"; r$: IF r$ = "y" OR r$ = "" THEN RUN SLEEP 2 256 SCREEN 0: CLS LOCATE 1, 1 PRINT "Labyrinth-O 2.20 J.Ryyppo 1994" PRINT 257 REM PRINT " " PRINT " See you in Kouvola! ( We will arrange FIN5, 5-event O-week -96)" PRINT " Keep on practicing !!!": SYSTEM 20 IF m$(x, y) = "1" AND q = 0 THEN : q = 1: t2 = TIMER IF m$(x, y) = "2" AND q = 1 THEN q = 2: t3 = TIMER IF m$(x, y) = "3" AND q = 2 THEN q = 3: t4 = TIMER IF m$(x, y) = "m" AND q = 3 THEN t5 = TIMER: EN = 2: RETURN CLS IF q = 3 THEN sr$ = " FINISH": ELSE : sr$ = STR$(q + 1) PRINT "Next goal :"; sr$ IF W$ = "y" THEN e$ = N$(1, 3): N$(1, 3) = "A": PRINT "XXXXXXXXX": FOR j = 0 TO 3: PRINT "XXX"; : FOR i = 0 TO 2: PRINT LEFT$(N$(i, j), 1); : NEXT: PRINT "XXX": NEXT: PRINT "XXXXXXXXX": N$(1, 3) = e$ IF N$(1, 2) = b$ AND N$(0, 2) <> b$ OR N$(0, 3) = b$ AND N$(1, 2) = b$ OR N$(0, 2) <> b$ OR N$(0, 3) <> b$ AND N$(1, 2) <> b$ THEN LINE (50, 37)-(50, 442) 'vasen pysty IF N$(1, 2) <> b$ AND N$(1, 1) = b$ AND N$(0, 1) <> b$ OR N$(1, 2) <> b$ AND N$(0, 2) = b$ AND N$(1, 1) = b$ OR N$(1, 2) <> b$ AND N$(0, 2) <> b$ AND N$(1, 1) <> b$ OR N$(1, 2) <> b$ AND N$(0, 2) = b$ AND N$(1, 1) <> b$ AND N$(0, 1) <> b$ THEN LINE (170, 128)-(170, 352) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(1, 0) = b$ AND N$(0, 0) <> b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(0, 1) = b$ AND N$(1, 0) = b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(0, 1) <> b$ AND N$(1, 0) <> b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(0, 1) = b$ AND N$(1, 0) <> b$ AND N$(0, 0) <> b$ THEN LINE (241, 180)-(241, 299) IF N$(1, 2) = b$ AND N$(2, 2) <> b$ OR N$(2, 3) = b$ AND N$(1, 2) = b$ OR N$(2, 2) <> b$ OR N$(2, 3) <> b$ AND N$(1, 2) <> b$ THEN LINE (590, 38)-(590, 442) 'oikea pysty IF N$(1, 2) <> b$ AND N$(1, 1) = b$ AND N$(2, 1) <> b$ OR N$(1, 2) <> b$ AND N$(2, 2) = b$ AND N$(1, 1) = b$ OR N$(1, 2) <> b$ AND N$(2, 2) <> b$ AND N$(1, 1) <> b$ OR N$(1, 2) <> b$ AND N$(2, 2) = b$ AND N$(1, 1) <> b$ AND N$(2, 1) <> b$ THEN LINE (470, 128)-(470, 352) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(1, 0) = b$ AND N$(2, 0) <> b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(2, 1) = b$ AND N$(1, 0) = b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(2, 1) <> b$ AND N$(1, 0) <> b$ OR N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(2, 1) = b$ AND N$(1, 0) <> b$ AND N$(2, 0) <> b$ THEN LINE (399, 180)-(399, 299) IF N$(1, 2) <> b$ AND N$(0, 2) = b$ THEN LINE (50, 37)-(170, 128): LINE (50, 442)-(170, 352): IF LEN(N$(1, 2)) > 1 THEN LINE (90, 220)-(140, 225)'vasen valiv IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(0, 1) = b$ THEN LINE (170, 128)-(241, 180): LINE (170, 352)-(241, 299): IF LEN(N$(1, 1)) > 1 THEN LINE (194, 227)-(217, 230) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(1, 0) <> b$ AND N$(0, 0) = b$ THEN LINE (241, 180)-(280, 212): LINE (241, 299)-(280, 266): IF LEN(N$(1, 0)) > 1 THEN LINE (253, 232)-(267, 234) IF N$(1, 2) <> b$ AND N$(2, 2) = b$ THEN LINE (590, 38)-(470, 128): LINE (590, 442)-(470, 352): IF LEN(N$(1, 2)) > 1 THEN LINE (550, 220)-(500, 225) 'oikea ylavv IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(2, 1) = b$ THEN LINE (470, 128)-(399, 180): LINE (470, 352)-(399, 299): IF LEN(N$(1, 1)) > 1 THEN LINE (446, 227)-(413, 230) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(1, 0) <> b$ AND N$(2, 0) = b$ THEN LINE (399, 180)-(357, 212): LINE (399, 299)-(357, 266): IF LEN(N$(1, 0)) > 1 THEN LINE (387, 232)-(373, 234) IF N$(1, 2) = b$ THEN LINE (50, 37)-(590, 37): LINE (50, 442)-(590, 442): IF LEN(N$(1, 3)) > 1 THEN LOCATE 14, 15: PRINT N$(1, 3)'katto IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(1, 0) = b$ THEN LINE (241, 180)-(399, 180): LINE (241, 299)-(399, 299): IF LEN(N$(1, 1)) > 1 THEN LINE (290, 228)-(350, 228) IF N$(1, 2) <> b$ AND N$(1, 1) = b$ THEN LINE (170, 128)-(470, 128): LINE (170, 352)-(470, 352): IF LEN(N$(1, 2)) > 1 THEN LINE (250, 219)-(390, 219) IF N$(0, 3) = b$ THEN LINE (50, 37)-(0, 0): LINE (50, 442)-(0, 480) 'nurkat IF N$(2, 3) = b$ THEN LINE (590, 37)-(640, 0): LINE (590, 442)-(640, 480) IF N$(0, 3) <> b$ AND N$(0, 2) = b$ THEN LINE (50, 37)-(0, 37): LINE (50, 442)-(0, 442) 'vasenylahaara IF N$(1, 2) <> b$ AND N$(0, 2) <> b$ AND N$(0, 1) = b$ THEN LINE (170, 128)-(50, 128): LINE (170, 352)-(50, 352) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(0, 1) <> b$ AND N$(0, 0) = b$ THEN LINE (241, 180)-(170, 180): LINE (241, 299)-(170, 299) IF N$(2, 3) <> b$ AND N$(2, 2) = b$ THEN LINE (590, 38)-(640, 38): LINE (590, 442)-(640, 442) 'oikea ylahaara IF N$(1, 2) <> b$ AND N$(2, 2) <> b$ AND N$(2, 1) = b$ THEN LINE (470, 128)-(590, 128): LINE (470, 352)-(590, 352) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND N$(2, 1) <> b$ AND N$(2, 0) = b$ THEN LINE (399, 180)-(470, 180): LINE (399, 299)-(470, 299) IF N$(1, 2) <> b$ AND N$(1, 1) <> b$ AND LEFT$(N$(1, 0), 1) <> " " AND N$(1, 0) <> b$ THEN LINE (315, 280)-(325, 280): LINE (313, 287)-(327, 287): LINE (327, 287)-(325, 280): LINE (313, 287)-(315, 280): LINE (313, 287)-(325, 281): LINE (319, 287)-(325, 284) 'rastit IF N$(1, 2) <> b$ AND LEFT$(N$(1, 1), 1) <> " " AND N$(1, 1) <> b$ THEN LINE (309, 324)-(332, 324): LINE (304, 334)-(337, 334): LINE (309, 324)-(304, 334): LINE (337, 334)-(332, 324): LINE (304, 334)-(332, 325): LINE (321, 334)-(335, 329): LINE (314, 334)-(333, 327): LINE (326, 334)-(335, 332) IF LEFT$(N$(1, 2), 1) <> " " AND N$(1, 2) <> b$ THEN LINE (303, 389)-(337, 389): LINE (295, 405)-(345, 405): LINE (295, 405)-(303, 389): LINE (345, 405)-(337, 389): LINE (295, 405)-(337, 390): LINE (316, 405)-(340, 398): LINE (306, 405)-(339, 394): LINE (326, 405)-(342, 401) IF v$ <> "y" THEN 21 IF s = 3 THEN LINE (470, 442)-(445, 400): LINE (470, 442)-(475, 435): LINE (470, 442)-(457, 437) IF s = 1 THEN LINE (465, 442)-(440, 400): LINE (440, 400)-(453, 405): LINE (440, 400)-(435, 407) IF s = 2 THEN LINE (425, 421)-(485, 421): LINE (425, 421)-(439, 427): LINE (425, 421)-(437, 416) IF s = 4 THEN LINE (425, 421)-(485, 421): LINE (485, 421)-(471, 415): LINE (485, 421)-(476, 428) 21 RETURN 350 COLOR 7: INPUT "Dropping out? (y/n) "; kes$ IF kes$ = "n" THEN RETURN EN = 1 INPUT "Exit to dos (y/n) "; kes$ IF kes$ = "y" THEN 256 RETURN 400 CLS : COLOR 1 FOR j = 2 TO 27: PRINT : FOR i = 2 TO 70 IF LEFT$(m$(i, j), 1) <> "" AND LEFT$(m$(i, j), 1) <> b$ THEN COLOR 3 PRINT LEFT$(m$(i, j), 1); COLOR 1: NEXT: NEXT: COLOR 4 LINE (4 + (x1 - 2) * 8, 8 + (y1 - 1) * 16)-(4 + (x2 - 2) * 8, 8 + (y2 - 1) * 16) LINE (4 + (x2 - 2) * 8, 8 + (y2 - 1) * 16)-(4 + (x3 - 2) * 8, 8 + (y3 - 1) * 16) LINE (4 + (x3 - 2) * 8, 8 + (y3 - 1) * 16)-(4 + (x4 - 2) * 8, 8 + (y4 - 1) * 16) LINE (4 + (x4 - 2) * 8, 8 + (y4 - 1) * 16)-(4 + (o - 2) * 8, 8 + (p - 1) * 16) x = 4 + (o - 2) * 8: y = 8 + (p - 1) * 16 a = LEN(rtt$): tutu = TIMER: COLOR 7 FOR z = 1 TO a WHILE TIMER < tutu + .02 WEND tutu = TIMER s = VAL(MID$(rtt$, z, 1)) IF s = 0 THEN COLOR 2: LINE (x - 5, y - 5)-(x + 5, y + 5): LINE (x + 5, y - 5)-(x - 5, y + 5): COLOR 7: IF kl$ = "y" OR ml$ = "y" THEN BEEP IF s = 1 THEN LINE (x, y)-(x, y - 16): LINE (x, y - 16)-(x - 2, y - 10): LINE (x, y - 16)-(x + 2, y - 10): y = y - 16 IF s = 2 THEN LINE (x, y)-(x + 8, y): LINE (x + 8, y)-(x + 4, y - 2): LINE (x + 8, y)-(x + 4, y + 2): x = x + 8 IF s = 3 THEN LINE (x, y)-(x, y + 16): LINE (x, y + 16)-(x - 2, y + 10): LINE (x, y + 16)-(x + 2, y + 10): y = y + 16 IF s = 4 THEN LINE (x, y)-(x - 8, y): LINE (x - 8, y)-(x - 4, y - 2): LINE (x - 8, y)-(x - 4, y + 2): x = x - 8 NEXT PRINT : PRINT " Press 'n'" WHILE INKEY$ <> CHR$(110) WEND: CLS RETURN 500 CLS : PRINT "Your PCs speed:"; vnk; " (486/66 or faster = 1)" PRINT " Select level: (spd is the speed level of the ghost runners) " PRINT " 1: E spd = "; INT(.65 * vnk * 100) / 100; " distance 100-130" PRINT " 2: A spd = "; vnk; " distance 70 - 90" PRINT " 3: C spd = "; 2.5 * vnk; " distance 50 - 75" PRINT " 4: SPRINT spd = "; INT(.6 * vnk ^ 1.5 * 100) / 100; " distance 40 - 52" INPUT " (1-4, enter= 1) "; puoli IF puoli = 1 OR puoli = 0 THEN puoli = 50: vk = .65 * vnk IF puoli = 2 THEN puoli = 35: vk = vnk IF puoli = 3 THEN puoli = 25: vk = vnk * 2.5 IF puoli = 4 THEN puoli = 20: vk = vnk ^ 1.5 * .6 INPUT " Do you want to change the speed of the ghost runners (spd) (y/n)"; v$ IF v$ = "y" THEN 502 ELSE : GOTO 503 502 PRINT " Bigger spd makes them less speedy." INPUT " Type the new spd (0- ) "; vk IF vk < 0 THEN 502 IF vk > 0 THEN vk = vk 503 vk = vk * .6: INPUT " Do you want to use compass ? (y/n), enter='y') "; v$ IF v$ <> "n" THEN v$ = "y" REM INPUT " Haluatko kayttaa apukartaa? (k/e, oletus 'e') "; w$ W$ = "n": REM IF w$ <> "y" THEN w$ = "n" INPUT " X mode. (Your location will be marked with letter X ? (y/n, enter 'n') "; r$ IF r$ <> "y" THEN r$ = "n" IF r$ = "y" THEN g = 1: ELSE : g = 0 INPUT " Beeps (y/n, enter = 'n') "; kl$ ml$ = kl$ RETURN 550 CLS : INPUT " Do you want to use compass ? (y/n), enter='y' "; v$ IF v$ <> "n" THEN v$ = "y" REM INPUT " Haluatko kayttaa apukarttaa? (k/e, oletus 'e') "; W$ W$ = "n": REM IF W$ <> "y" THEN w$ = "n" INPUT " X mode. (Your location will be marked with letter X ? (y/n, enter 'n')"; r$ IF r$ <> "y" THEN r$ = "n" IF r$ = "y" THEN g = 1: ELSE : g = 0 INPUT " Beeps (y/n) enter ='n' "; kl$ ml$ = kl$ RETURN DATA Kun ei tee mitaan - ei tee mitaan vaarin DATA ----> E X I T ---->,<---- E X I T ----,<--- Rastille ,----> Rastille DATA UMPIKUJA ----->,<---- UMPIKUJA,Killroy was here,Kysyva tielle eksyy DATA Killroy was here,Turha yrittaa eksyt kuitenkin! DATA Neurovelho suoraviivaa,Kello kay - HOP-HOP,HYVa SUOMI,Johdat 15 sekunnilla min,Paina - paina -Jalle karkaa! DATA <--- VARAULOSKaYNTI, VARAULOSKaYNTI --->,Tupakointi kielletty,No Smoking DATA Sahkopaakeskus, Hairioita magneettikentassa - kompassi ei toimi. DATA Pyykkituvan kaytto vain talon asukkaille,Varo! Lattia vahattu! DATA Opaskarttoja saatavana INFO-pisteesta,One Way ---->,<---- One Way DATA Toll Road - 20 FIM, Pysakointi kielletty, Tyhjakaynti kiellety DATA Tunneli rakenteilla - kulku omalla vastuulla.,!!! Edessa miinakentta !!! DATA Maali suljetaan minuutin kuluttua.,Yrittaisit edes!,Luvaton oleskelu kielletty DATA Tessun Baari- Auki aina 03.30 asti.,ALE-ALE- Kybernetiikkaa sikahalvalla -ALE-ALE DATA Keijoa!! - Taalta sita saa,Hermoratahieroja Pentti Hirvo ark.9-16 DATA Varo koiraa !, Paasy kielletty DATA Ei mopoille (<=386SX),Onko kadessasi Pro -kartta?,Onko elaman tarkoitus 42? DATA Porilainen paivassa pitaa mielen virkeana, Oletteko te humalassa?? DATA Sotilasalue - Paasy kielletty, Taalta yrttikeijo - vain 41 FIM! DATA Muista hana!,Meilta teho-rasvaimu - jopa 5 kg/min!!!, <----- Vaestonsuoja, Vaestonsuoja ---->,,,51 1000 SCREEN 12: CLS : RANDOMIZE TIMER IF pe - 1 < 1 THEN tos(1, qg) = (6 + RND * 4) * pit * vk: tyh(1) = tyh(1) + tos(1, qg): pe$(1) = "Ylermi Yksjalka" IF pe - 1 < 2 THEN tos(2, qg) = (5 + RND * 4) * pit * vk: tyh(2) = tyh(2) + tos(2, qg): pe$(2) = "Leevi Lahna " IF pe - 1 < 3 THEN tos(3, qg) = (4 + RND * 3) * pit * vk: tyh(3) = tyh(3) + tos(3, qg): pe$(3) = "P Saukko " IF pe - 1 < 4 THEN tos(4, qg) = (4 + RND * 3) * pit * vk: tyh(4) = tyh(4) + tos(4, qg): pe$(4) = "Pasi Kuikka " IF pe - 1 < 5 THEN tos(5, qg) = (3 + RND * 3) * pit * vk: tyh(5) = tyh(5) + tos(5, qg): pe$(5) = "Pentti Hirvo " IF pe - 1 < 6 THEN tos(6, qg) = (3 + RND * 3) * pit * vk: tyh(6) = tyh(6) + tos(6, qg): pe$(6) = "Klonkku " IF pe - 1 < 7 THEN tos(7, qg) = (2.8 + RND * 2.5) * pit * vk: tyh(7) = tyh(7) + tos(7, qg): pe$(7) = "Mr. Hyde " IF pe - 1 < 8 THEN tos(8, qg) = (2.5 + RND * 2.5) * pit * vk: tyh(8) = tyh(8) + tos(8, qg): pe$(8) = "Tri Jekyll " IF pe - 1 < 9 THEN tos(9, qg) = (2.2 + RND * 1.5) * pit * vk: tyh(9) = tyh(9) + tos(9, qg): pe$(9) = "Ariadne " IF pe - 1 < 10 THEN tos(10, qg) = (2 + RND * 2) * pit * vk: tyh(10) = tyh(10) + tos(10, qg): pe$(10) = "Ford Perfect " IF pe < 11 THEN tos(11, qg) = (1.8 + RND * 3) * pit * vk: tyh(11) = tyh(11) + tos(11, qg): pe$(11) = "Harri Hazardi " IF pe < 12 THEN tos(12, qg) = (2 + RND * 1) * pit * vk: tyh(12) = tyh(12) + tos(12, qg): pe$(12) = "Bilbo Reppuli " IF pe < 13 THEN tos(13, qg) = (1.9 + RND * 1.5) * pit * vk: tyh(13) = tyh(13) + tos(13, qg): pe$(13) = "Pirjo Piikkari " IF pe < 14 THEN tos(14, qg) = (1.8 + RND * 1.2) * pit * vk: tyh(14) = tyh(14) + tos(14, qg): pe$(14) = "Oiva Reitti " IF pe < 15 THEN tos(15, qg) = (1.7 + RND * 1.1) * pit * vk: tyh(15) = tyh(15) + tos(15, qg): pe$(15) = "Tapio Aarnimetsa " IF pe < 16 THEN tos(16, qg) = (1.6 + RND * 1) * pit * vk: tyh(16) = tyh(16) + tos(16, qg): pe$(16) = "Noand Rapidshill " IF pe < 17 THEN tos(17, qg) = (1.55 + RND * 1.2) * pit * vk: tyh(17) = tyh(17) + tos(17, qg): pe$(17) = "Matti Reijonen " IF pe < 18 THEN tos(18, qg) = (1.6 + RND * .8) * pit * vk: tyh(18) = tyh(18) + tos(18, qg): pe$(18) = "Sari Kallinen " IF pe < 19 THEN tos(19, qg) = (1.5 + RND * .8) * pit * vk: tyh(19) = tyh(19) + tos(19, qg): pe$(19) = "Jarl Gripenberg " RESTORE 1100: i = INT(RND * 13 + 1): FOR j = 1 TO i: READ ratam$: NEXT FOR i = 0 TO 19: ii = 999999999 FOR j = 0 TO 19 IF tyh(j) < ii AND jro%(j) = 0 THEN iii = j: ii = tyh(j) NEXT: jro%(iii) = i + 1: NEXT FOR i = 0 TO 19: jr%(jro%(i) - 1) = i: NEXT: ERASE jro% FOR i = 0 TO 19: ii = 999999999 FOR j = 0 TO 19 IF tos(j, qg) < ii AND jro%(j) = 0 THEN iii = j: ii = tos(j, qg) NEXT: jro%(iii) = i + 1: NEXT PRINT : PRINT " TULOKSET: Course setter: "; ratam$ PRINT " The speed level of the ghosts was "; vk / .6; " Level: "; IF puoli = 50 THEN PRINT "E" IF puoli = 35 THEN PRINT "A" IF puoli = 25 THEN PRINT "C" IF puoli = 20 THEN PRINT "SPRINT": ELSE : PRINT LOCATE 4, 1: PRINT " Event:" FOR i = 1 TO qg: LOCATE 4, 6 * i + 21: PRINT " "; i: NEXT: LOCATE 4, 22 + 6 * i: PRINT "Pos.": LOCATE 4, 29 + 6 * i: PRINT "Total:" FOR i = 0 TO 19 PRINT MID$(STR$(i + 1) + ". ", 2, 3) LOCATE 5 + i, 4: PRINT pe$(jr%(i)) FOR j = 1 TO qg: LOCATE 5 + i, 6 * j + 22: ttm = INT(tos(jr%(i), j) / 60): tts = INT(tos(jr%(i), j) - ttm * 60) PRINT MID$(STR$(ttm), 2, LEN(STR$(ttm)) - 1) + ":"; MID$(STR$(tts), 2, LEN(STR$(tts)) - 1): NEXT j LOCATE 5 + i, 6 * j + 23 ttm = INT(tyh(jr%(i)) / 60): tts = INT((tyh(jr%(i)) - ttm * 60) * 100) / 100 PRINT MID$(STR$(jro%(jr%(i))) + ". ", 2, 3) LOCATE 5 + i, 6 * j + 29: PRINT MID$(STR$(ttm), 2, LEN(STR$(ttm)) - 1) + ":"; MID$(STR$(tts), 2, LEN(STR$(tts)) - 1) NEXT i PRINT " Press 'n'" ERASE jr%, jro% FOR i = 0 TO 19: IF i > pe THEN pe$(i) = "" NEXT: ratam$ = "" WHILE INKEY$ = CHR$(110) WEND WHILE INKEY$ <> CHR$(110) WEND RETURN Virheet: SCREEN 0: CLS : PRINT : PRINT " Your PC wanted a coffee break !!!": SYSTEM END 1100 DATA C=64,VIC-20,Neuromancer,ESKO,Wintermute,Kannel,Mato,Mopo,Lisa,HAL 9000,IBM-PC,Omena,Lahna,,,, 1200 SCREEN 12: tapu = TIMER: COLOR 0: CLS : FOR k = 1 TO 10: CLS PRINT "XXX": PRINT "XXXXXXXXX": LINE (50, 37)-(50, 442) 'vasen pysty LINE (170, 128)-(170, 352) LINE (241, 180)-(241, 299) LINE (590, 38)-(590, 442) 'oikea pysty LINE (470, 128)-(470, 352) LINE (399, 180)-(399, 299) LINE (50, 37)-(170, 128): LINE (50, 442)-(170, 352): LINE (90, 220)-(140, 225)'vasen valiv LINE (170, 128)-(241, 180): LINE (170, 352)-(241, 299): LINE (194, 227)-(217, 230) LINE (241, 180)-(280, 212): LINE (241, 299)-(280, 266): LINE (253, 232)-(267, 234) LINE (590, 442)-(470, 352): LINE (550, 220)-(500, 225) 'oikea ylavv LINE (470, 128)-(399, 180): LINE (470, 352)-(399, 299): LINE (446, 227)-(413, 230) LINE (399, 180)-(357, 212): LINE (399, 299)-(357, 266): LINE (387, 232)-(373, 234) LINE (50, 442)-(590, 442) LINE (241, 180)-(399, 180): LINE (241, 299)-(399, 299): LINE (290, 228)-(350, 228) LINE (170, 352)-(470, 352): LINE (250, 219)-(390, 219) LINE (50, 37)-(0, 0): LINE (50, 442)-(0, 480) 'nurkat LINE (590, 37)-(640, 0): LINE (590, 442)-(640, 480) LINE (50, 37)-(0, 37): LINE (50, 442)-(0, 442) 'vasenylahaara LINE (170, 128)-(50, 128): LINE (170, 352)-(50, 352) LINE (241, 180)-(170, 180): LINE (241, 299)-(170, 299) LINE (590, 38)-(640, 38): LINE (590, 442)-(640, 442) 'oikea ylahaara LINE (470, 128)-(590, 128): LINE (470, 352)-(590, 352) LINE (399, 180)-(470, 180): LINE (399, 299)-(470, 299) LINE (315, 280)-(325, 280): LINE (313, 287)-(327, 287): LINE (327, 287)-(325, 280): LINE (313, 287)-(315, 280): LINE (313, 287)-(325, 281): LINE (319, 287)-(325, 284) 'rastit LINE (309, 324)-(332, 324): LINE (304, 334)-(337, 334): LINE (309, 324)-(304, 334): LINE (337, 334)-(332, 324): LINE (304, 334)-(332, 325): LINE (321, 334)-(335, 329): LINE (314, 334)-(333, 327): LINE (326, 334)-(335, 332) LINE (295, 405)-(345, 405): LINE (295, 405)-(303, 389): LINE (345, 405)-(337, 389): LINE (295, 405)-(337, 390): LINE (316, 405)-(340, 398): LINE (306, 405)-(339, 394): LINE (326, 405)-(342, 401) LINE (470, 442)-(475, 435): LINE (470, 442)-(457, 437) LINE (465, 442)-(440, 400): LINE (440, 400)-(453, 405): LINE (440, 400)-(435, 407) LINE (425, 421)-(485, 421): LINE (425, 421)-(439, 427): LINE (425, 421)-(437, 416) LINE (425, 421)-(485, 421): LINE (485, 421)-(471, 415): LINE (485, 421)-(476, 428) NEXT: CLS FOR k = 1 TO 3 FOR j = 2 TO 27: PRINT : FOR i = 2 TO 70 PRINT "x"; NEXT: NEXT CLS NEXT COLOR 7 tapu = TIMER - tapu RETURN 1300 CLS : RANDOMIZE TIMER: PRINT " LABYRINTH-ORIENTEERING" b$ = CHR$(219): l = 0 FOR x = 0 TO 75: FOR y = 0 TO 40: m$(x, y) = b$: NEXT IF INKEY$ <> "" THEN 1302 NEXT FOR i = 1 TO 6 x = INT(RND * 67) + 3 y = INT(RND * 19) + 3 m$(x, y) = " ": NEXT LOCATE 1, 1 FOR j = 2 TO 22: PRINT : FOR i = 2 TO 70 PRINT LEFT$(m$(i, j), 1); NEXT: NEXT: PRINT " PRESS A BUTTON." 1306 REM 1301 t = t + 1: x = INT(RND * 67) + 3 y = INT(RND * 19) + 3 IF t > 1000 THEN 1309 IF INKEY$ <> "" THEN 1302 IF m$(x, y) = " " THEN GOTO 1301 IF m$(x - 1, y) <> " " AND m$(x, y - 1) <> " " AND m$(x + 1, y) <> " " AND m$(x, y + 1) <> " " THEN 1301 IF m$(x - 1, y) = " " AND m$(x - 1, y - 1) = " " AND m$(x, y - 1) = " " THEN 1301 IF m$(x, y - 1) = " " AND m$(x + 1, y - 1) = " " AND m$(x + 1, y) = " " THEN 1301 IF m$(x + 1, y) = " " AND m$(x + 1, y + 1) = " " AND m$(x, y + 1) = " " THEN 1301 IF m$(x, y + 1) = " " AND m$(x - 1, y + 1) = " " AND m$(x - 1, y) = " " THEN 1301 m$(x, y) = " ": t = 0: LOCATE y, x - 1: PRINT " " l = l + 1: IF l > 1000 THEN 1309 IF INKEY$ = "" THEN 1306 1302 l = 0: RUN 99 1309 FOR a = 1 TO 1000: NEXT t = TIMER: FOR a = 1 TO 5000: NEXT: s = TIMER - t: f = 100 * 1 / s LOCATE 1, 1 FOR j = 2 TO 22: PRINT : FOR i = 2 TO 70 PRINT LEFT$(m$(i, j), 1); NEXT: NEXT: PRINT " PRESS A BUTTON." 1310 i = 2: j = 1: x1 = INT(RND * 67) + 3 y1 = INT(RND * 19) + 3 x = INT(RND * 67) + 3: y = INT(RND * 19) + 3 IF m$(x, y) <> " " THEN 1310 IF m$(x1, y1) <> " " THEN 1310 LOCATE y1, x1 - 1: PRINT "m": tutu = TIMER 1311 IF RND < .2 THEN s = INT(RND * 4) + 1 IF INKEY$ <> "" THEN 1302 IF s = 1 AND m$(x, y - 1) <> b$ THEN y = y - 1 IF s = 2 AND m$(x + 1, y) <> b$ THEN x = x + 1 IF s = 3 AND m$(x, y + 1) <> b$ THEN y = y + 1 IF s = 4 AND m$(x - 1, y) <> b$ THEN x = x - 1 IF x = i AND y = j THEN s = INT(RND * 4) + 1: GOTO 1311 1313 FOR g = 1 TO f: NEXT LOCATE j, i - 1: PRINT " " IF x = x1 AND y = y1 THEN BEEP: SLEEP 3: RUN LOCATE y, x - 1: PRINT "*": i = x: j = y GOTO 1311