Circle Calculator

I was sitting in Math class, punching numbers into my clculator to get the Area, Diameter, Circumference, etc., when i came up with the idea for this Calculator. Just adjust the Circle Size to the desired size, and tap twice to calculate, its saved me lots of time! I plan

``````-- Circle Calculator
-- By: CodeaNoob
-- March 10th, 2013
-- Use this function to perform your initial
CircleSize = WIDTH
function setup()
saveProjectInfo("Description", "A Calculator to find Circumference,Diameter, and Area of a Circle")
saveProjectInfo("Author", "CodeaNoob")
parameter.watch("Circumference")
parameter.watch("Diameter")
parameter.integer("CircleSize",1,999)
parameter.watch("Area")
end
-- This function gets called once every frame
function draw()
background(67, 67, 67, 255)
textMode(CORNER)
textAlign(CENTER)
font("AmericanTypewriter-Light")
fontSize(25)
fill(0, 0, 0, 255)
text("Drag to Calculate", 10, HEIGHT-50)
-- This sets a dark background color
fill(255, 255, 255, 255)
ellipseMode(CORNER)
ellipse( 100,100,CircleSize)
Diameter = CircleSize
Circumference = math.pi * CircleSize/2
end
-- This sets the line thickness

``````

Some one please help with the formatting! I put it between tildes and this is what happens, ive done it before without this happening

click enter after typing the three tildes

thanks for the program

The tildes must be on a line by themselves with no leading spaces.

a1) Why double tap? Make calculations a live update.

a2) CircleSize is the same as the diameter, please make it obsolete, especially as the “size of a circle” is quite ambiguous. Will almost automatically be a result of solving a1.

b) Make it a bit more outstanding by adjusting the circle’s size by touching the screen and setting the radius to your finger’s position. This assumes you already know (or learn about) the circle equation.

``````
--# Main
-- Circle Calculator
-- By: Codea Noob (updated by edat44)
-- March 10th, 2013
-- Use this function to perform your initial
function setup()
saveProjectInfo("Description", "A Calculator to find Circumference,Diameter, and Area of a Circle")
saveProjectInfo("Author", "CodeaNoob")
parameter.watch("Circumference")
parameter.watch("Diameter")
-- a max value of 350
parameter.watch("Area")
end
-- This function gets called once every frame
function draw()
Area = math.pi * math.pow(Radius, 2) -- A slightly more formal way to write Radius times itself
background(67, 67, 67, 255)
textMode(CENTER) -- Center mode is easier to allign in the middle
textAlign(CENTER)
font("AmericanTypewriter-Light")
fontSize(25)
fill(0, 0, 0, 255)
text("Drag to Calculate", WIDTH/2, HEIGHT-50)
fill(255, 255, 255, 255)