red=Color.new(255,0,0)
green=Color.new(0,255,0)

x=0

oldpad = Controls.read()
while true do
screen:clear()
pad = Controls.read()
if pad:start() then
	dofile("./System/formula.lua")
	break;
end

screen:print(100,100,"Surface Area: " .. (x*x)*4 .. "    Volume: " .. x*x*x,green)
screen:print(100,120,"Height (or width or length): " .. x, red)

if pad:left() and pad:left() ~= oldpad:left() then
	x=x-1
end
if pad:right() and pad:right() ~= oldpad:right() then
	x=x+1
end
screen.waitVblankStart()
screen.flip()
oldpad=pad
end