Doodle

Author(s): Peter Wylie
Publication: LISTing Newsletter
Date: May 1993
Pages: 10

DOODLE is one of the most useful programs we have received for the ZX-81 tinkerer.

It provides a way of drawing in eight directions under cursor control. Keys 5 to 8 give the usual four points of the compass, while I, O, K and L give the points between.

Key W gives UNPLOT and you can return to PLOT with Q. If you have a printer you can input Z for an instant COPY; if not, omit line 85. Key 0 clears the screen.

As listed, the routine is set up for the 1K machine and will let you draw only over a part of the screen. If a RAM pack is used you can work on the whole screen by changing the listing as follows:

In line 70, where “A is less than 53” and “A is greater than 10”, change to “A is less than 63” and “A is greater than 0 respectively. In line 80, “B is less than 35” and “B is greater than 8” become “B is less than 43” and “B is greater than 0”.

Thanks to Peter Wylie, of Christchurch, Dorset, for this very worthwhile routine.

 10 LET A=30
20 LET B=20
30 LET C=1
40 PLOT A,B
50 IF C=2 THEN UNPLOT A,B
60 LET U$=INKEY$
70 LET A=A+((U$="8" OR U$="L" OR U$="O") AND A<53)-((U$="5" OR U$="I" OR U$="K") AND A>10)
80 LET B=B+((U$="7" OR U$="I" OR U$="O") AND B<35)-((U$="6" OR U$="K" OR U$="L") AND B>8)
85 IF U$="Z" THEN COPY
90 IF U$="Q" THEN LET C=1
100 IF U$="W" THEN LET C=2
110 IF U$="0" THEN CLS
120 UNPLOT A,B
130 GOTO 40

Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.