34S Mini-Challenge : A to Z
|
08-26-2016, 02:44 PM
Post: #1
|
|||
|
|||
34S Mini-Challenge : A to Z
Here's a compressed menu/scan routine for converting key scan codes for A-Z to 1-26 and all others to negative values (for demo display) in 39 steps. This includes a full set of labels (1 for A-Z as a group, and 1 each for the other keys; Y and EXIT are excluded by firmware) for the user to insert their code:
http://www.hpmuseum.org/forum/thread-673...60137.html The challenge is can this demo/routine be compressed further? Yip, Nick (= |
|||
08-26-2016, 03:49 PM
Post: #2
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
Nice job! It's pretty well compressed already.
But ... as it is a challenge, here is a 37 steps version: Code: 01 LBL 'KEY' |
|||
08-26-2016, 11:43 PM
(This post was last modified: 08-27-2016 12:54 AM by Nick.)
Post: #3
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-26-2016 03:49 PM)Didier Lachieze Wrote: Nice job! It's pretty well compressed already. Wow! I love it -- great idea! Works out well that most of the codes have a 0-offset Y value too..... 4 whole steps (net 2)... *poofed*. Congrats! I added a linkback from the listing thread with credit for your improvement. Yip! Nick (= |
|||
08-27-2016, 01:23 AM
Post: #4
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-26-2016 11:43 PM)Nick Wrote: I added a linkback from the listing thread with credit for your improvement. Nick - Challenges and replies do belong in topical threads like this, but the Library Forums are intended for completed solutions, sort of like a reference library with working solutions. So it's great to create these and encourage participation, and possibly even post the final (best) reply in a library forum, but cross-posting while the dialogue is evolving is both confusing and unnecessary. Thanks for the challenge. --Bob Prosperi |
|||
08-27-2016, 03:52 AM
(This post was last modified: 08-27-2016 05:07 AM by Nick.)
Post: #5
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
Bob,
You were right -- I just showed this to someone and it was confusing to present it to them across two threads. If you look at the library code though, it's maintained neatly with revision commentary. I think it's the separate discussion that's confusing which does belong here, but how can you tell when something like this can't be optimized further? I considered brute-forcing the problem, trying a number of potential iterations over a cluster computer but that would be cheating. (It worked for Google and the Rubik's Cube.) Thanks, Nick Edit: Was more confusing than I had realized. |
|||
08-27-2016, 03:53 AM
Post: #6
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
Make this a separate program (with and END) and put it in your flash library. Then the label use doesn't impact any other program.
Almost seems like we should have implemented an [alpha]KY? command Although, your solution is definitely smaller than a native implementation would be. Pauli |
|||
08-27-2016, 03:59 AM
(This post was last modified: 08-27-2016 05:34 AM by Nick.)
Post: #7
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-27-2016 03:53 AM)Paul Dale Wrote: Make this a separate program (with and END) and put it in your flash library. Then the label use doesn't impact any other program. Pauli, Hi from a fan! *waves* Oh, yea. I considered adding a comment to the library thread about referencing external programs and maybe a version with a toggle mode between numeric and alpha for fun (as a different snipplet). But if you do that, then you have to add lowercase... where does it end? If the HP 82240A could print one character at a time on a single line, I'd have a typewriter! But I don't need anything other than A-Z for where this is going. I completed some routines for a port of a lesser-known but significant program that is uniquely better suited for a calculator than a PC and am still working out the UI. I plan to release it open-source and reveal the name at the same time. Thanks! Nick Edit: Someone said she loves your avatar! Davros? |
|||
08-27-2016, 06:59 AM
Post: #8
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-27-2016 03:59 AM)Nick Wrote: If the HP 82240A could print one character at a time on a single line, I'd have a typewriter! This is Marcus's domain, not mine Quote:Edit: Someone said she loves your avatar! Davros? My avatar is of the three Davros miniatures I've painted thus far. The first two are metal and are properly based. The third is a plastic cast I made of another metal one and it is waiting to be suitably frozen in an acrylic cryotube -- I didn't want to risk any metallic interactions (outgassing) with the resin I'll be using. For those unaware, Davros is a character from the 1970's (& later) Dr Who series. She is clearly very well educated and knowledgable Pauli |
|||
08-27-2016, 09:37 AM
(This post was last modified: 08-28-2016 08:11 PM by Nick.)
Post: #9
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
Printing Word Processor (It's not my typewriter, but it does print stuff...)
Usage: f, g, h are all [Shift] with = as the annunciator (Flag A) A-Z appends a character [Shift]A-Z appends a lowercase character ENTER will Print + Clear [Shift]ENTER will Print (without Clear) <- will Backspace [Shift]<- will Clear 0 is Space Y is forgotten Code: 01 LBL 'WP' Comments: - There's room to tweak when the shift keys clear or not. - Other annunciators such as 360/GRAD could be used for additional Shift keys. - Numerics / punctuation could be added. - Bold / Underline / Mode 1 / Mode 2 could be added. - The 82240A font could be selected if you're using an 82240B. - A blinking ViewA could be used to render a cursor for text editing. - CPX could simplify every operation. - The forgotten Y key could be asked for forgiveness. Inspiration: - Special thanks to Someone Special who's Someone other than Someone, Pauli, the Daleks, and these words from the 3.1 manual: "Nevertheless, do not forget that your WP 34S is mainly designed as a programmable calculator." |
|||
08-27-2016, 09:52 AM
(This post was last modified: 08-27-2016 10:17 AM by Nick.)
Post: #10
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-27-2016 06:59 AM)Paul Dale Wrote:(08-27-2016 03:59 AM)Nick Wrote: If the HP 82240A could print one character at a time on a single line, I'd have a typewriter! I've read the technical guide and through my highly scientific process of fiddling around, I have a feeling it's a hardware problem. Q. How many programmers does it take to screw in a light bulb? A. None! It's a hardware problem! ...but while we're on the subject, my wish list would include monospace as an option for Mode 1 and Mode 2. Nick (: |
|||
08-30-2016, 03:30 PM
Post: #11
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-27-2016 09:52 AM)Nick Wrote:(08-27-2016 06:59 AM)Paul Dale Wrote: This is Marcus's domain, not mine I agree. The printer only prints when a line is complete. (08-27-2016 09:52 AM)Nick Wrote: ...but while we're on the subject, my wish list would include monospace as an option for Mode 1 and Mode 2. This is what ⎙MODE 0 is for. You can position the cursor with ⎙TAB n to align output in any mode. Marcus von Cube Wehrheim, Germany http://www.mvcsys.de http://wp34s.sf.net http://mvcsys.de/doc/basic-compare.html |
|||
08-31-2016, 01:40 AM
Post: #12
|
|||
|
|||
RE: 34S Mini-Challenge : A to Z
(08-30-2016 03:30 PM)Marcus von Cube Wrote:(08-27-2016 09:52 AM)Nick Wrote: ...monospace as an option for Mode 1 and Mode 2. *light bulb* Thanks, Marcus! I'm trying that out tonight to see how it looks... I never considered using it per character -- that's great... |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 6 Guest(s)