The Museum of HP Calculators

HP Forum Archive 19

 Still in awe over HP50gMessage #1 Posted by Glenn Shields on 15 Aug 2010, 12:29 a.m. 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

 Re: Still in awe over HP50gMessage #2 Posted by Vieira, Luiz C. (Brazil) on 15 Aug 2010, 6:23 p.m.,in response to message #1 by Glenn Shields 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.

 Re: Still in awe over HP50gMessage #3 Posted by Glenn Shields on 16 Aug 2010, 1:26 p.m.,in response to message #2 by Vieira, Luiz C. (Brazil) 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

 Re: Still in awe over HP50gMessage #4 Posted by David Hayden on 16 Aug 2010, 10:53 p.m.,in response to message #1 by Glenn Shields 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.

 Re: Still in awe over HP50gMessage #5 Posted by Crawl on 17 Aug 2010, 9:43 a.m.,in response to message #1 by Glenn Shields 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.

Go back to the main exhibit hall