num1 = {}
num2 = {}
num3 = {}

var1 = {}
var2 = {}

test2 = {}

test = -60 --modify if using large variables.

for a = 1, 10 do
	var1[a] = 0
	var2[a]=0
	num1[a] = 0
	num2[a]=0
	test2[a] = 0
end
num1[1]=16
num2[1]=28

num1[2]=20
num2[2]=36

num1[3]=2
num2[3]=-8

num1[4]=-3
num2[4]=-28

num1[5]=-19
num2[5]=48

num1[6]=-22
num2[6]=72

num1[7]=-16
num2[7]=15

num1[8]=-22
num2[8]=72

num1[9]=-10
num2[9]=24

num1[10]=-29
num2[10]=54

while true do
screen:clear()
pad = Controls.read()
test = test+1
for a = 1, 10 do
		test2[a]=num2[a]/test
	if num1[a] == test+test2[a] then
		var1[a] = test
		var2[a] = test2[a]
		var1[a] = var1[a]
		var2[a] = var2[a]
		end		
		screen:print(20,a*20-10,"original equation:  X^2+" .. num1[a] .. "X+" .. num2[a],Color.new(0,255,0))
		screen:print(20,a*20,"(x+" .. var1[a] .. ")(x+" .. var2[a] .. ")" .. "  possible solutions for 0:  " .. var1[a]*-1 .. "," .. var2[a]*-1,Color.new(0,255,0))
		screen:print(0,0,"Solved by 10$man's Polynomial engine",Color.new(255,0,0))
		screen:print(0,a*20,a,Color.new(0,0,255))
	end
	
	screen:print(0,242,"Numbers that come out as 0,0 are prime aka no solution ",Color.new(0,255,0))
	screen:print(0,252,"(or not a whole number solution)",Color.new(0,255,0))
	screen:print(20,262,"April 6, 2010           Press Start to go back...",Color.new(255,0,0))
	screen:print(10,232,"Testing: " .. test .. " for posible solutions...", Color.new(0,255,255))
	if pad:start() then
		dofile("./System/poloptions.lua")
		break;
	end
	
screen.waitVblankStart()
screen.flip()
end
