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:

(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.

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.)

(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.

Almost seems like we should have implemented an [alpha]KY? command Although, your solution is definitely smaller than a native implementation would be.

Pauli

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.

(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.

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

- 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."