Below you will find pages that utilize the taxonomy term “HP”
April 5, 2024
10 PRINT on the HP-42s
Over 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.