<BACK>
Mini challenge #5: "Feel like a HP" <closed>
Maths are quite important in modern corewar warriors, so this time i propose an unusual math challenge.
You have to create a routine wich calculate the N-th derivate of a given equation of the form:
A0 + A1*x + A2*x^2 + A3*x^3 + ... = 0
Generic: S An*x^n=0, derivated: S An*n*x^(n-1)=0
An can be positive or negative.
Ok, ok. Calm dawn, it is much easier than it seems.
There are no redcoding limitations.
You are free to decide how the equation is given. Your code must be cappable of derivate any equation of the form seen below N times.
I think the most important thing is the way you describe the equation in a table, (please explain it in your entries).
(entries are listed by length)
|
Author |
Result |
Lines |
Comments |
|
OK |
4 |
||
|
OK |
4 |
||
|
OK |
4, (really 5) |
Excelent idea! |
|
|
OK |
7 |
||
|
OK |
7 |
||
|
OK |
2 |
Based on Houston’s idea |
(Equation is not included in the length).