10 PRINT on the HP-42s
By Michael Doornbos
- One minute read - 206 wordsOver the years, I’ve been on a silly quest to do 10PRINT on as many things as I can. They end up on X, here, or sometimes both.
I hadn’t considered it before because I just figured I couldn’t print the "/"
and "\"
characters on the HP-42s.
I was wrong. It’s pretty easy. After a few minutes in the manual, I figured it out.
00 { 45-Byte Prgm }
01▸LBL "TEN"
02 RAN
03 RAN
04 X>Y?
05 GTO "\"
06▸LBL "/"
07 ├"/"
08 AVIEW
09 PSE
10 GTO "TEN"
11▸LBL "\"
12 ├"\"
13 AVIEW
14 PSE
15 GTO "TEN"
16 END
The program is pretty simple. It generates two random numbers and compares them. If the first is greater than the second, it prints a "/"
and goes to the next iteration. If the second is greater than the first, it prints a "\"
and goes to the next iteration.
It works great on the SwissMicros DM42 and free42 emulators as well.
Extra credit
Can you think of a better way to do it, or do you have a different calculator this might be fun on? I’d love to hear about it.
I’m always looking for new things to try this on.