Challenge: Generate 24 in the X register / display
|
09-07-2020, 09:01 PM
Post: #28
|
|||
|
|||
RE: Challenge: Generate 24 in the X register / display
My no digits solution is three steps:
Code: 01 pi Without CEIL, it's four steps (on a 41): Code: 01 pi This provides a limit on solutions because the digits can be entered first and ignored: Code: 01 0 I.e. there is a digit independent way of getting the result in six bytes/steps assuming all the used functionality is available on the device in question. Okay, pi isn't permitted since it is a constant but that leads onto: For digits 1 - 9, there is an eight step solution.
Assume the digit is d: Code: 01 d Since we're aiming for the fewest steps, having this limit sets a bar -- not necessarily a very low bar but a bar. This doesn't mean that longer solutions aren't interesting. There is also an eight step solution for the digit 0. On the other end of the scale, we must use each digit thrice and doing so cannot get the answer of 24. Therefore, the minimal program must be 4 or more steps/bytes. I suspect it has to be more than 4 in all cases (but no doubt will be proven wrong). |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 1 Guest(s)