ZX Computings - OpenLibra
ZX Computings - OpenLibra
ZX Computings - OpenLibra
You also want an ePaper? Increase the reach of your titles
YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.
Micro<br />
This program it fascinating to<br />
watch, and makes a good demonstration<br />
of the <strong>ZX</strong>81, A 'mouse'<br />
fan inverse asterisk) starts off in<br />
a random position somewhere near<br />
the top left hand corner of the<br />
9creen. It is aiming for the bottom<br />
right hand corner. There is a solid<br />
black 'frame' on the screen, and a<br />
number of obstacles are placed<br />
randomly within the frame. When<br />
the mouse finally makes it to the<br />
1 REM MICROMOU5E<br />
5 LET G = 16398<br />
6 LET H=G + 1<br />
10 PRINT RT 0.0<br />
II<br />
35<br />
«•<br />
ii<br />
36<br />
ii<br />
l*<br />
37<br />
I*<br />
end, the number of moves it took<br />
is shown.<br />
The obstacles change position,<br />
the mouse flashes off and on a<br />
few times, and then begins again.<br />
The mouse cannot get itself into a<br />
trap it cannot get out of, unless<br />
it happens to land in one at the<br />
very beginning, so have patience,<br />
no matter how long it seems to<br />
be taking.<br />
1BK<br />
FOR R =1 TO 20<br />
PRINT RT 2 +RND#18, 1 +RND#27;<br />
PRINT RT 2+RND*18_. 1 +RND #27,;<br />
PRINT RT 2 +RND f 18.. 1 +RND #27.;<br />
*•<br />
4-2 PRINT RT R/0;"M"<br />
4-3 PRINT RT 3+RNDH5, 2 +RND#22;<br />
-» »•<br />
4.4. PRINT RT 2+RNDHB, 1 #RNP.#27;<br />
tl it<br />
4-5 PRINT RT 2 +RND # 18 2#RND*24;<br />
4.6 PRINT RT 34RND*15, 2 +RND #27;<br />
47 PRINT RT 2+RNDH8, 2 + RND #24- J<br />
MQ t<br />
IS PRINT RT R . 31; "•'*<br />
57 PRINT RT 2 +RND* 16.. 2 -f RND #26.;<br />
60 NEXT R<br />
61 FOR Z=1 TO 13<br />
62 PRINT RT 20.30;" "<br />
63 PRINT RT 20,30; ' B"<br />
64- PRINT RT 20 . 30 : "fS"<br />
65 PRINT RT 20.30;" "<br />
66 PRINT RT 20,30;"D"<br />
67 PRINT RT 20.30;" "<br />
68 NEXT Z<br />
70 LET R = INT (RND*6 + 1)<br />
75 LET Q=0<br />
80 LET B = INT (RND*15fl)<br />
85 PRINT RT 20.30;" "<br />
90 LET E=R<br />
95 LET Q=Q+1<br />
100 LET F=B<br />
101 IF R =20 RND B =30 THEN GOTO<br />
2000<br />
105 LET T=0<br />
106 IF RND > . 24-78 THEN GOTO 120<br />
110 LET Y = INT ( RND #7 ) +1<br />
Y=1 THEN GOTO 120<br />
Y=6 THEN GOTO 169<br />
Y-3 THEN GOTO 200<br />
Y=4- THEN GOTO 250<br />
Y=5 THEN GOTO 290<br />
Y =2 THEN PPTD J<br />
Y=7 THEN GOTO 330<br />
INT RT R+l,Bj<br />
PEEK (PEEK G +256 *PEEK H><br />
=0 THEN LET T-1<br />
14-0 IF T = 1 THEN LET R=R*1<br />
150 IF T=1 THEN GOTO 1000<br />
152 IF RND > * 2 THEN GOTO 169<br />
154. IF R=0 OR B =30 THEN GOTO 16<br />
9 155 PRINT RT R-1,B#1;<br />
156 IF PEEK CPEEK G+256#PEEK H)<br />
=0 THEN LET T =1<br />
157 IF T = 1 THEN LET B =B<br />
158 IF T = 1 THEN LET R = R-1<br />
159 IF T = 1 THEN GOTO 1000<br />
165 IF RND0 THEN LET B=B<br />
320 IF T ~ 1 THEN GOTO 1000<br />
330 IF B =0 OR R = 0 THEN GOTO 110<br />
34.0 PRINT RT R-l^B-1;<br />
350 IF PEEK (PEEK G 4-256 #PEEK -H.»<br />
=0 THEN LET T=1<br />
360 IF T = 1 THEN LET R=R-1<br />
370 IF T = 1 THEN LET B = B-1<br />
380 IF T = 1 THEN GOTO 100P»<br />
390 GOTO 110<br />
1000 PRINT RT E.F;" "<br />
1010 PRINT RT R,B;"B"<br />
1020 GOTO 90<br />
2000 PRINT RT 0.. 15 O; *Ji"<br />
2010 FOR N = 1 TO 50<br />
2020 NEXT N<br />
2030 PRINT RT 0,15;"|<br />
204.0 GOTO 30