im making some programs for school on my TI calculator in the BASIC code (the one you program directly onto the calculator). This program takes an equation like x^4+10x^3+35x^2+50x+24 and turn it into (x+1)(x+2)(x+3)(x+4)... like a "supercharged" quadratic formula.
Code:
solve(Y1,x,11)-->a
solve(Y1,x,10)-->b
solve(Y1,x,9)-->c
solve(Y1,x,8)-->d
.........
solve(Y1,x,-11)-->y
anyways, i get a bunch of possible numbers (using the "solve" function to get the x intercepts, which are the 1, 2, 3, and 4 in the simplified equation). But... when i do it i get something like (x+1)(x+3)(x+1)(x+2)(x+3)(x+4)(x+2)(x+4)(x+2)
so i have all the correct numbers, its just a matter of eliminating the repeated ones.
right now i have it as soemthing like "if a=b, don't output"... but then it doesnt check if a=j...
does anyone have an idea of how to check this on a large scale (If a=b, if a=c, if a=d.... if y=w) without actually writing it all out? i was thinking i can do something like replacing the variable... so then say d-->a, goto xx
lol, and sorry if this makes no sense.....