20.02.2013 Views

ZX Computings - OpenLibra

ZX Computings - OpenLibra

ZX Computings - OpenLibra

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Th» simple little program, quite<br />

apart from enabling one to draw<br />

pretty picture* on the screen of<br />

one's <strong>ZX</strong>80, shows how you can<br />

control on-screen movement. You<br />

can change the symbol in use and<br />

the direction in which you are<br />

moving st any time during the<br />

program execution.<br />

Instructions and Variables<br />

When the program is RUN an<br />

asterisk (star) it displayed on the<br />

screen. To alter the symbol in use<br />

press '5' then 'NEWLINE' followed<br />

by the code of the required symbol<br />

and 'NEWLINE'. Changes in the<br />

direction of movement can be made<br />

by keying the desired direction<br />

code ( see Fig. 1.) and the inevitable<br />

'NEWLINE'<br />

The program uses the following<br />

variables:<br />

D<br />

C<br />

A<br />

I<br />

- Position on-screen of current<br />

symbol.<br />

Code of displayed symbol.<br />

Direction code.<br />

Dummy variable.<br />

Games<br />

zx Drawing Board<br />

Sample Program<br />

1 REM "5KETCHPPD<br />

5 FR5T<br />

6 FOR N =0 TO 63<br />

7 PLOT N., 4-3<br />

8 PLOT N,O<br />

9 NEXT N<br />

10 FOR P =0 TO 4-3<br />

11 PLOT 0.P<br />

12 PLOT 63,P<br />

13 NEXT P<br />

15 5LOU<br />

20 LET X = 32<br />

30 LET Y = 22<br />

40 GOSUB 500<br />

50 UNPLOT X,Y<br />

60 PLOT X J Y<br />

70 GOTO 4-0<br />

80 GOSUB 500<br />

90 GOTO 80<br />

100 GOSUB 500<br />

110 PLOT X,Y<br />

120 UNPLOT X,Y<br />

130 GOTO 100<br />

500 IF INKEY*=<br />

«« ^ M<br />

510 IF INKEY $ = ** 2 "<br />

520 IF INKEY%=<br />

530 IF INKEY$= "0" THEN<br />

540 IF INKEY $ = " 5 " THEN<br />

550 IF INKEY$= "6"<br />

560 IF INKEY%-<br />

*A M<br />

570 IF INKEY "Q"<br />

590 RETURN<br />

Try the following data string,<br />

the '/* represents the NEWLINE. A)<br />

5/128/8/4/2/2/4/4/2/2/2/2/6/6/2/6/8/6/6/6/6/6/ f<br />

6/2/6/8/6/6/8/4/8/8/8/8/8/6/8/4/4/4/2/2/2/4/4/ £<br />

4/4/4/4/8/8/8/5/8/9/9/9/9. qq<br />

4 + 6<br />

GOTO 40<br />

GOTO<br />

GOTO 600<br />

GOTO 100<br />

LET X = X —<br />

THEN LET Y=Y-<br />

THEN LET Y =Y +<br />

THEN LET X=X +<br />

10<br />

70<br />

80<br />

90<br />

100<br />

110<br />

120<br />

130<br />

140<br />

150<br />

160<br />

170<br />

LET D = 310<br />

LET C = 20<br />

FOR I = 1 T.O 640<br />

PRINT" ";<br />

NEXT I<br />

50 FOR N=0 TO 100©<br />

POKE PEEKH6396) +<br />

256'PEEK( 16397) + D,C<br />

INPUT A<br />

IF A= 1 THEN LET D = D + 32l<br />

IF A = 2 THEN LET D = D + 3S<br />

IF A = 3 THEN LET D = D + 34<br />

IF A = 4 THEN LET D = D-1 I<br />

IF A = 6 THEN LET D = D + 1<br />

IF A = 7 THEN LET D=D-3if<br />

IF A = 8 THEN LET D = D-33|<br />

IF A = 9 THEN LET D = D -321<br />

IF A = 5 THEN INPUT C<br />

GOTO 60<br />

From Kowloon, Hong Kong.<br />

H. Hugh McAllum show* ut<br />

a few tricks with the <strong>ZX</strong> printer<br />

H.H.H.1982<br />

M T * = J W T tRND*22) +10<br />

70 LET Y=INT IRND*22)<br />

80 IF X +Y

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!