Utility Draw

Author(s): Peter Safranek
Publication: LISTing Newsletter
Date: May 1993
Pages: 4

PETER SAFRANEK of Ashford, Middlesex, has sent a very useful graphics program for the 16K or 48K Spectrum. Commands available are “o” to input the over; “d” to draw for inputted x and y and draw x and draw y; “c” to draw a circle around inputted x and y co-ordinates and inputted radius; “s” to save the design on the screen as a SCREENS; and “r” to re-set the flashing pixel cursor to inputted x and y co-ordinates.

The pixel cursor is moved in any one of eight directions using the eight letters around “H” on the keyboard—i.e., T, Y, U, G, J, B, N and M. Once you have entered the program you can SAVE it by entering “RUN 550”.

Practice and patience can produce displays like the map of Europe shown; an outline on the screen in washable ink was a help for this, Safranek reports. The advantage of such a saveable display for educational purposes is obvious (16 or 48K)

100 REM Utility Draw
110 REM (c) 1982 P Safranek
120 GO SUB 340: CLS : LET x=0: LET y=0
130 LET a$=INKEY$
140 IF a$<>"o" AND a$<>"d" AND a$<>"s" AND a$<>"r" AND a$<>"c" THEN GO TO 210
150 IF a$="o" THEN GO SUB 390
160 IF a$="d" THEN GO SUB 430
180 IF a$="s" THEN GO SUB 520
190 IF a$="r" THEN GO SUB 410
200 IF a$="c" THEN GO SUB 490
210 LET x=x+(a$="j")-(a$="g")
220 LET y=y+(a$="y")-(a$="n")
230 LET x=x+(a$="u")-(a$="b")
240 LET y=y+(a$="u")-(a$="b")
250 LET x=x+(a$="m")-(a$="t")
260 LET y=y+(a$="t")-(a$="m")
270 IF x<0 THEN LET x=0
280 IF x>255 THEN LET x=255
290 IF y>175 THEN LET y=175
300 IF y<0 THEN LET y=0
310 PLOT x,y: PLOT OVER 1;x,y
320 PLOT x,y: PLOT OVER 0;x,y
330 GO TO 130
340 INPUT "ink [0-7]?";i'"paper [0-7]?";p'"border[0-7]?";b
350 IF i<0 OR i>7 THEN GO TO 340
360 IF p<0 OR i>7 THEN GO TO 340
370 IF b<0 OR b>7 THEN GO TO 340
380 BORDER b: PAPER p: INK i
390 INPUT "over[0 or 1]?";o: IF o<>1 AND o<>0 THEN GO TO 390
400 RETURN
410 INPUT "x?";x,"y?";y
420 RETURN
430 INPUT "x coord";a
440 INPUT "y coord";b
450 INPUT "draw x?";c
460 INPUT "draw y?";d
470 PLOT a,b: DRAW c,d
480 RETURN
490 INPUT "x?";xx;"y?";yy;"r?";r
500 CIRCLE xx,yy,r
510 RETURN
520 INPUT "Name?"; LINE f$
530 SAVE f$SCREEN$
540 RETURN
550 SAVE "ut.draw" LINE 100
Map of Europe drawn with Utility Draw on a TV screen
Map of Europe drawn with Utility Draw on a TV screen

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