Post Reply 
HHC 2021 Programming Contests - Surprise !
10-19-2021, 09:53 PM
Post: #37
RE: HHC 2021 Programming Contests - Surprise !
(10-12-2021 05:55 PM)Gene Wrote:  Note: ALENG does not violate the rules, as it is part of the extended functions present on the HP-41CX.

Following up on this, even thought ALENG was "legal", I created a version using "LOG IP...". I was actually able to create a slightly shorter version using LOG IP instead of ALENG, which pleased me, but the pleasure was short-lived as I quickly found that the program failed for an input of zero, declaring "Invalid Data", due to attempting to take the log of zero. Zero was not test number, and the palindromes are defined as positive integers in the rules, so I do not know if zero, or all negative numbers for that matter, were intended to be valid inputs. If so, the correct output for zero or negative would be 1, probably easiest just to add a test, if less than or equal to zero, just output 1. The "count up until palindrome is found" routines would not have this problem with zero, but would presumably have to test for negatives.

Dave - My mind is going - I can feel it.
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: HHC 2021 Programming Contests - Surprise ! - Jeff O. - 10-19-2021 09:53 PM



User(s) browsing this thread: 10 Guest(s)