Graph-Graph

Publication: LISTing Newsletter
Date: June - July 1991
Pages: 7

Input an equation containing – X or y or both and the computer will print a graph. For ZX/81-TS/1000 Submitted by: ZX Users Group of New York.

 10 PRINT "INPUT AN EQUATION CONTAINING    X OR Y OR BOTH"
20 DIM W(2,64)
30 INPUT Z$
40 CLS
50 FAST
60 FOR Y=0 TO 21
70 FOR X=0 TO 42
80 LET Z=VAL Z$+Y
90 IF Z<W(2,X+Y+1) OR NOT Y OR X=42 THEN LET W(2,X+Y+1)=Z
100 IF Z>W(1,X+Y+1) OR NOT Y OR X=42 THEN LET W(1,X+Y+1)=Z
110 IF W(2,X+Y+1)=Z OR W(1,X+Y+1)=Z THEN IF Z<44 AND Z>-1 THEN PLOT X+Y,Z
120 NEXT X
130 NEXT Y
140 SLOW
150 PRINT AT 0,0;Z$
160 GOTO 30

Sample Run:

SIN (X/13)*SIN (Y/6.5)*30

Sample run graph of SIN (X/13)*SIN (Y/6.5)*30
Sample run graph of SIN (X/13)*SIN (Y/6.5)*30

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