Circles on a ZX80

Anything Sinclair ZX Basic related; history, development, tips - differences between BASIC on the ZX80 and ZX81
Post Reply
Its1982again
Posts: 79
Joined: Tue Aug 04, 2020 6:26 pm

Circles on a ZX80

Post 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! 😂😂😂
ZX80 (white psu)
Issue 1 ZX81
32k comp mod ZX81 filesixty keyboard
Issue 1 Spectrum
Issue 2 Specrum
Toastrack
Issue 3 in Lo-Profile keyboard
Harlequin 128
DivMMC future
vdrive
TZXduino
ZX printer
Alphacom printer
spocek
Posts: 6
Joined: Sun Oct 08, 2023 6:13 am

Re: Circles on a ZX80

Post 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
User avatar
Paul
Posts: 1545
Joined: Thu May 27, 2010 8:15 am
Location: Germanys west end

Re: Circles on a ZX80

Post 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
In theory, there is no difference between theory and practice. But, in practice, there is.
spocek
Posts: 6
Joined: Sun Oct 08, 2023 6:13 am

Re: Circles on a ZX80

Post 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.
User avatar
1024MAK
Posts: 5189
Joined: Mon Sep 26, 2011 10:56 am
Location: Looking forward to summer in Somerset, UK...

Re: Circles on a ZX80

Post by 1024MAK »

Yes, the lack of trigonometry functions and floating point numbers makes it a tad more difficult compared to the ZX81 ROM…

Mark
ZX81 Variations
ZX81 Chip Pin-outs
ZX81 Video Transistor Amp

:!: Standby alert :!:
There are four lights!
Step up to red alert. Sir, are you absolutely sure? It does mean changing the bulb :!:
Looking forward to summer being good this year.
User avatar
GCHarder
Posts: 437
Joined: Sat Dec 14, 2013 7:46 pm

Re: Circles on a ZX80

Post by GCHarder »

Post Reply