This is a read-only snapshot of the ComputerCraft forums, taken in April 2020.
Emma's profile picture

Circle Generator

Started by Emma, 19 June 2014 - 03:27 PM
Emma #1
Posted 19 June 2014 - 05:27 PM
I got bored today so I decided to use my knowledge of trigonometry and make a circle generator as an API, now, there are two ways to use it, through API or from the command line.
Examples:

API:
Spoiler

os.loadAPI("circles")
circles.setX(20)
circles.setY(10)
circles.drawCircle(5,64,true)
Where the 5 is the radius and 64 is the number of points to generate.
True means it will clear the screen beforehand
Command Line:
Spoiler

circles 5 64
Where the 5 is the radius and 64 is the number of points to generate.
Also, in the command line it defaults to the center of the screen.

So, yeah. Knock yourself out.
Code: http://pastebin.com/zNXeAmMi
lebalusch #2
Posted 19 June 2014 - 05:32 PM
Would be nice if you could do a dome one too :-)
Emma #3
Posted 19 June 2014 - 07:44 PM
Would be nice if you could do a dome one too :-)
Just make a whole bunch of circles and layer them together :P/>