HP Forums
Programming challenge (HP 12C) - Printable Version

+- HP Forums (https://archived.hpcalc.org/museumforum)
+-- Forum: HP Museum Forums (https://archived.hpcalc.org/museumforum/forum-1.html)
+--- Forum: Old HP Forum Archives (https://archived.hpcalc.org/museumforum/forum-2.html)
+--- Thread: Programming challenge (HP 12C) (/thread-16214.html)



Programming challenge (HP 12C) - mapet - 03-28-2002

Write the shortest (measured by steps not keystokes) program for 3 root...Platform: HP 12C


Re: Programming challenge (HP 12C) - Frank Glitz - 03-28-2002

Is it allowed to use y^x? :-) Or the LN / e^x functions? :-) Or should algorithms avoiding these functions be used? :-(
How large is your solution (if you have one yet...)?


Re: Programming challenge (HP 12C) - mapet - 03-28-2002

My solution is 4 steps long, but it seems that you've already guessed it ... :-)

BTW y^x makes it 5 steps long.
I have to work on more difficult challenge next time...


Re: Programming challenge (HP 12C) - Frank Glitz - 03-28-2002

> I have to work on more difficult challenge next time...

Not really! Just don't allow the usage of these functions of the 12C. That's a little harder nut to crack (for someone whose math courses are long-forgotten, like me ;-) Someone remembers how to do?


Re: Programming challenge (HP 12C) - May I? - Vieira, Luiz C. (Brazil) - 03-28-2002

Hello;

I did not get to the point (Sorry!). What is 3 root?




Re: Programming challenge (HP 12C) - Thibaut.be - 03-28-2002

I guess this is you solution :

y = e^((ln x)/3)

so the steps are :

01 43 23 g e^x
02 3 3
03 10 /
04 43 22 g LN


Note how it is easy in a HP to calculate a apperently more complicated formula...


Re: Programming challenge (HP 12C) - John Ioannidis - 03-28-2002

Why is this even a challenge? [3] [1/x] [y^x]
three steps, three keystrokes.