var digit1, digit2, counter, sum, prod, i, done, a, b, c, common1, common2 : int
var x : string
setscreen ("text:max;max")
loop
put "Enter the value for.."
put "\tA: " ..
get a
put "\tB: " ..
get b
put "\tC: " ..
get c
put "What letter would you like to use as a variable? " ..
get x
if a = 1 then
put "\n\t", x, chr (178), "+", b, x, "+", c
else
put "\n\t", a, x, chr (178), "+", b, x, "+", c
end if
sum := b
prod := a * c
done := 0
counter := -100
loop
i := -101
loop
i := i + 1
if counter * i = prod and counter + i = sum then
put "\nProd: ", prod, " = ", counter, " x ", i
put "Sum: ", sum, " = ", counter, " + ", i
done := 1
end if
exit when i = 100 or done = 1
end loop
exit when done = 1
counter := counter + 1
end loop
if a = 1 then
put "\n(", x, chr (178), "+", i, x, ") (", counter, x, "+", c, ")"
else
put "\n(", a, x, chr (178), "+", i, x, ") (", counter, x, "+", c, ")"
end if
put "What is common in the first part of the equation?(besides ", x, ")if nothing enter 1 " ..
get common1
put "The seccond? " ..
get common2
if a = 1 then
put "\n", x, chr (178), "+", b, x, "+", c
else
put "\n", a, x, chr (178), "+", b, x, "+", c
end if
if a = 1 then
put "(", x, chr (178), "+", i, x, ") (", counter, x, "+", c, ")"
else
put "(", a, x, chr (178), "+", i, x, ") (", counter, x, "+", c, ")"
end if
if common1 = 1 and a = 1 and counter / common2 = 1 then
put x, "(", x, "+", i / common1, ")+", common2, "(", x, "+", c / common2, ")"
put "(", x, "+", i / common1, ")(", x, "+", common2, ")"
elsif common1 = a then
put common1, x, "(", x, "+", i / common1, ")+", common2, "(", counter / common2, x, "+", c / common2, ")"
put "(", common1, x, "+", i / common1, ")(", common1, x, "+", common2, ")"
elsif common1 = 1 and a = 1 then
put x, "(", x, "+", i / common1, ")+", common2, "(", counter / common2, x, "+", c / common2, ")"
put "(", x, "+", i / common1, ")(", common1, x, "+", common2, ")"
elsif common2 = 1 and a = 1 then
put x, "(", x, "+", i / common1, ")+", common2, "(", counter / common2, x, "+", c / common2, ")"
put "(", x, "+", i / common1, ")(", common1, x, "+", common2, ")"
elsif common1 = 1 then
put x, "(", a / common1, x, "+", i / common1, ")+", common2, "(", counter / common2, x, "+", c / common2, ")"
put "(", a / common1, x, "+", i / common1, ")(", common1, x, "+", common2, ")"
else
put common1, x, "(", a / common1, x, "+", i / common1, ")+", common2, "(", counter / common2, x, "+", c / common2, ")"
put "(", a / common1, x, "+", i / common1, ")(", common1, x, "+", common2, ")\n\n\n"
end if
delay (1000)
loop
exit when hasch
end loop
end loop
|