Page 1 of 1
Circles on a ZX80
Posted: Tue Dec 05, 2023 4:10 pm
by Its1982again
Currently playing about with my ZX80.
What's the best way to program it to draw a circle?
Might sound very basic but that's where i'm at!
Re: Circles on a ZX80
Posted: Sun Dec 10, 2023 4:14 pm
by spocek
Try this and let us know how it goes:
10 FOR ANGLE = 0 TO 360 STEP 5
20 LET X = RND * 10 * SIN(ANGLE)
30 LET Y = RND * 10 * COS(ANGLE)
40 PLOT 96 + INT(X), 48 + INT(Y)
50 NEXT ANGLE
Re: Circles on a ZX80
Posted: Sun Dec 10, 2023 6:23 pm
by Paul
I doubt it can work.
ZX80 only uses integer math, no trigonometry, no PLOT.
Hence the question and why there was no answer.
It's far from easy if you want to calculate it.
Of course you can take a circle , convert the content to ZX80 string and print it.
But that's a solution to a different question
Or change the ZX80 ROM to a ZX81 ROM
Re: Circles on a ZX80
Posted: Sun Dec 10, 2023 7:17 pm
by spocek
The above works with the ZX81 only. My mistake: the ZX80 only supports integers, and to create a circle, you must work with decimal numbers.
Re: Circles on a ZX80
Posted: Sun Dec 10, 2023 8:39 pm
by 1024MAK
Yes, the lack of trigonometry functions and floating point numbers makes it a tad more difficult compared to the ZX81 ROMβ¦
Mark
Re: Circles on a ZX80
Posted: Sun Dec 10, 2023 9:54 pm
by GCHarder