HP Forums

Full Version: Still in awe over HP50g
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

I know I'm a random contributor and biased toward the 50g (but still like the 35s, 33s, and 20s). Looking at the "recursive programming" examples in the AUR, I recalled the number of nested subroutines of the 35s, which is 20. But the 50g has this ability only limited by its memory, and can "unwind" this nesting with amazing speed.
As an illustration, this program will run through recursions of itself until the limiting number is reached (1000 here), then unwind through the "end"s in just a fraction of a second. If you make it 2000 loops, it barely becomes noticable that it is busy "ending" the loops and finishing the program.
<< 1 + DUP IF 1000 =/= THEN DUP 1 DISP RECUR END >>
Store in 'RECUR' and start with a 0 in the stack. Pretty amazing, no?
cheers, Glenn

Hi, Glenn;

I wrote a small recursive program (recursive programs tend to be small while doing big things...) for DFS - Depth-First Search - using matrix representations for graphs. I still need to refine it because it has some parts that might be reduced, but it calls itself each tine a vertex is found in a branch being searched. Because it uses local and global variables and it is not optimized, searching takes a lot of time and adding new branches causes the program to take some considerable extra time. It does not use Dijkstra's algorithm, the idea is just to show that it must test all possibilities, not only the shortest path.

I wrote it to show my students that if an HP50G could handle DFS with such a small code, they would be able to do that with Delphi easily.

It´s been two years and none of them has yet beaten my listing...

User RPL is amazing, ahn?

Cheers.

Luiz (Brazil)


Edited: 15 Aug 2010, 8:13 p.m.

Thank you, Luiz, for your input - I don't know much about your subject but appreciate having something new to explore. I found so many additional tips and info for the 50g and RPL in general through this forum and other posts (Graham Kendall?), and I hope that by sharing random stuff that somebody new to this system will have more to work with. Cheers, Glenn

I have the same awe but for a different reason. I enjoy playing with C code on the 50g and it's hard to believe that this little hand-held device is as fast as a desktop PC from 10 or 15 years ago.

I've had a 49g+ since 2004 (updated to a 50g not because I really needed to, but when Circuit City put them on clearance when they went out of business I figured why not) and have been in awe of it continuously ever since. It makes me feel like I'm living in the future every time I use it. For some people, they'd need a flying car to feel like that. For me, it's a pocket (more or less...) calculator that can do algebra.