Figure plotting trouble

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
User avatar
AN7805
Posts: 91
Joined: Fri Oct 16, 2020 4:17 am

Figure plotting trouble

Post by AN7805 »

Hi at all,

I have an trouble to plotting this figure.
It's working or is a error in the program?
The figure is start and stop at 4/100.

Image

Thanks.

Matt :-)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Figure plotting trouble

Post by XavSnap »

Seem ok,
But don't type-in "C","O","S" or "S","I","N" in the line 140...

Use "SHIFT"+"New/Line" then type "W" to get the "COS" function.
"SHIFT"+"New/Line" then type "Q" to get the "SIN" function.

The 4 error point to a variable error, not setup... (LET COS=0)…
In this program SIN & COS are numerics functions.

Code: Select all

10 REM LISSAJOUS SKETCHPAD 
20 REM BY FRAZER MELTON 
30 PRINT "INPUT STEPS" 
40 INPUT S 
50 PRINT S;" INPUT Y FREQUENCY" 
55 INPUT Y 
70 PRINT Y;" INPUT X FREQUENCY" 
80 INPUT X 
85 CLS 
87 PRINT "STEP ";S;"  Y ";Y;"  X ";X 
90 FOR A=0 TO 2*PI STEP 2*PI/S 
100 PLOT 20*SIN (A*Y)+30,20*COS (A*X)+20
110 NEXT A 
115 INPUT U$ 
117 IF U$<>"" THEN COPY 
120 CLS 
130 RUN 
LISSAJOUS.P
(1.2 KiB) Downloaded 161 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
AN7805
Posts: 91
Joined: Fri Oct 16, 2020 4:17 am

Re: Figure plotting trouble

Post by AN7805 »

Thanks Xav,

did you mean the line 100?
Yes i have type the function COS and SIN with SHIFT.
But not working, tommorw i try again.

Thanks for the list ;-)

Matt
User avatar
PokeMon
Posts: 2264
Joined: Sat Sep 17, 2011 6:48 pm

Re: Figure plotting trouble

Post by PokeMon »

XavSnap wrote: Sat Nov 28, 2020 5:19 am The 4 error point to a variable error, not setup... (LET COS=0)…
In this program SIN & COS are numerics functions.
Error 4 means out of memory.
How much memory is installed, Matt ?

Matt, I think it is a 1k problem.
What gives PRINT PEEK 16389 ?
Should be 128 (16k) not 68 (1k).
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Figure plotting trouble

Post by XavSnap »

:shock:
4...
What 4...
Argh…

Thanks PokeMon… to remember me this…

1 K release.

Code: Select all

10 LET S =VAL"300"
20 LET Y =VAL"9"
30 LET X =VAL"4"
40 PRINT "STEP ";S;"  Y ";Y;"  X ";X 
90 FOR A=0 TO 2*PI STEP 2*PI/S 
100 PLOT 20*SIN (A*Y)+30,20*COS (A*X)+20
110 NEXT A 
120 IF INKEY$<>"" THEN GOTO VAL"120"
But, it remember something else !

On a 16k ram Zx81... to compress and convert a program in a 1k format…

Move the RAMTOP to : (72=2K-TS1000, screen compressed above this value)
POKE 16389,72
PRINT USR 1040
SAVE"1k"

1K.P
(331 Bytes) Downloaded 168 times
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
AN7805
Posts: 91
Joined: Fri Oct 16, 2020 4:17 am

Re: Figure plotting trouble

Post by AN7805 »

PokEmon Xav; yes i have 1k only :-(
Any possibilty to plotting this figure at 1k?

Thanks.

Matt :-)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Figure plotting trouble

Post by XavSnap »

Yes, the diet previous listing seem working in one k.
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
User avatar
AN7805
Posts: 91
Joined: Fri Oct 16, 2020 4:17 am

Re: Figure plotting trouble

Post by AN7805 »

Thank so much Xav m(_ _)m

Matt
User avatar
AN7805
Posts: 91
Joined: Fri Oct 16, 2020 4:17 am

Re: Figure plotting trouble

Post by AN7805 »

Xav a question;

How to convert a 16k figure in compress 1k?
What i need?

Thanks,

Matt :-)
User avatar
XavSnap
Posts: 1940
Joined: Sat May 10, 2008 4:23 pm
Location: 'Zx81 France' Fb group.

Re: Figure plotting trouble

Post by XavSnap »

Hi Matt,

The "compress" process isn't a special zipping 1k mode… :lol:

To use a program in 1k, you had to enter you listing using some changes to save memory.

VAL"123" save memory.
the screen will be automatically "compressed" in the 1k/2k mode (the ROM scan the memory).
Delete all REMs.
Use Booleans function, instead of "IF" command.
Use as few lines as possible, lines headers spend memory.

16k:
1 REM HELLO WORL PROGRAM
2 REM BY ME…
3 REM ----------------------------
5 FOR A=1 TO 2
10 IF A=1 THEN PRINT "HELLO";
20 IF A=2 THEN PRINT " WORD";
30 NEXT A

1K:
5 FOR A=PI/PI TO VAL"2"
10 PRINT ;"HELLO" AND A=PI/PI;" WORLD" AND A=VAL"2";
30 NEXT A
Xavier ...on the Facebook groupe : "Zx81 France"(fr)
Post Reply