[TIB] TI-83 Program Challenge


[Prev][Next][Index][Thread]

[TIB] TI-83 Program Challenge





Well, here's another programming challenge for those interested.
The platform: TI-83 or 83+.
The context: I'm making a user-friendly synthetic division program,
in which the user enters a polynomial and a linear factor, and the
program returns the result of the division.

The challenge:

You have a Y-var (e.g., Y1) containing a polynomial in the form
"AX^M+BX^N+...", where A,B,... are real numbers and M,N,... are
non-negative integers.  In other words, a regular polynomial as the
user would enter it at the prompt.

Your mission (should you choose to accept it) is to generate a list
(e.g., L1) containing the coefficients of the equation in order, given
as input (in whatever form you choose) the equation and its polynomial
order (the highest power of X in the equation).

Solutions need not worry about "minus" versus "plus"+"negative", nor
about "X" versus "X^1" or "N" versus "NX^0"; I can handle those cases
easily enough before the major processing task.

Sample program runs:
-----------------------------------------------
"X^2+2X+1" -> Y1       |    "X^3-5+1.5X" -> Y1
               Done    |                   Done
2:prgmTRYTEST          |    3:prgmTRYTEST
               Done    |                   Done
L1                     |    L1
            {1 2 1}    |           {1 0 1.5 -5}
-----------------------------------------------