HHC 2017 programming contest revisited
|
11-30-2018, 12:45 AM
(This post was last modified: 11-30-2018 03:28 AM by Don Shepherd.)
Post: #1
|
|||
|
|||
HHC 2017 programming contest revisited
Recall the programming contest for last year's HHC-2017 conference regarding finding "happy" and "unhappy" numbers. I recently acquired a Sharp PC-1211 Pocket Computer (vintage 1980) which runs BASIC. I decided to write a happy number finder for it. Then I decided to write an equivalent RPN routine for my 12c (vintage 2001, not the much faster 12c+). Then I ran several tests with the machines side-by-side so I could compare the speeds. Amazingly enough, each machine took EXACTLY the same amount of time when determining whether a number was happy or unhappy. So BASIC vintage 1980 was equivalent to RPN vintage 2001. Very interesting.
Here is the code. Code:
|
|||
11-30-2018, 12:48 AM
Post: #2
|
|||
|
|||
RE: HHC 2017 programming contest revisited
Thank you for this. Glad you thought of it again.
Gene |
|||
11-30-2018, 01:59 AM
Post: #3
|
|||
|
|||
RE: HHC 2017 programming contest revisited
Very nice program.
What if 100 change to EEX 2 is this help speed up the 12C at bit? Gamo |
|||
11-30-2018, 02:37 AM
Post: #4
|
|||
|
|||
RE: HHC 2017 programming contest revisited
(11-30-2018 01:59 AM)Gamo Wrote: Very nice program.Thanks Gamo. I tried that and it had no obvious effect. There might be some microscopic time improvement of EEX 2 versus 100, but the number of iterations for this program loop is so small there is no obvious improvement in speed for the 12c. Don |
|||
11-30-2018, 04:30 PM
Post: #5
|
|||
|
|||
RE: HHC 2017 programming contest revisited | |||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)