22 - WO - Word guessing (Hangman)

Post Reply
Peet
Posts: 94
Joined: Tue Sep 29, 2020 12:01 am
Location: Germany

22 - WO - Word guessing (Hangman)

Post by Peet »

HP41 Standard Applications (modified).
Changes (among others): local label instead of global, small dictionary (one player mode)

Usage: XEQ "WO"
Display: "WORD?"
Input: R/S (to use the dictionary) or a word (with 6 characters) R/S
Display: "LETTER?"
Input: your guess, a letter or the complete word R/S

Code: Select all

LBL "WO"
LBL 04
FIX 0
XROM 26,36	; XEQ "ZZ" (Basics) or XROM 26,36 (TRNG - DM41X) or XROM 01,49 (RAN - DM42)
15		
*		; ZZ between 0 and 14
10
+		; now 10 to 24
XEQ IND X	; IND uses INT(value)
ASTO 08
CF 23
AON
"WORD=?"
PROMPT
FS?C 23
ASTO 08
CLA
ARCL 08
6
XEQ 01
.9
STO 17
"      "
ASTO 09
16.01
XEQ 01
LBL 02
CLA
ASTO 09
ASTO Y
"LETTER?"
PROMPT
ASTO 10
ISG 17
1.006
STO 18
RCL 10
RCL 08
X=Y?
GTO 03
LBL 06
" "
ASTO Y
RCL 18
10
+
CLA
ARCL IND X
RDN
ASTO X
X#Y?
GTO 00
CLA
ARCL 10
ASTO Y
CLA
ARCL IND 18
ASTO X
X=Y?
GTO 00
" "
ASTO X
LBL 00
CLA
ARCL 09
ARCL X
ASTO 09
"|-="
ARCL 18
AVIEW 
10
RCL 18
+
CLA
ARCL Y
ASTO IND X
ISG 18
GTO 06
CLA
ARCL 08
ASTO Y
CLA
ARCL 09
ASTO X
VIEW X
X=Y?
GTO 00
PSE
PSE
GTO 02
LBL 00
LBL 03
"WORD IS: "
ARCL 08
AVIEW
PSE
PSE
CLA
RCL 17
INT
ARCL X
"|- GUESSES"
AOFF
FIX 4
PROMPT
GTO 04
LBL 01
STO 07
ASTO 19
LBL 07
" "
ARCL 19
ASTO 19
ASHF
ASTO IND 07
DSE 07
GTO 07
RTN
LBL 10
"AUGUST"
RTN
LBL 11
"BITTER"
RTN
LBL 12
"HAMMER"
RTN
LBL 13
"IMPORT"
RTN
LBL 14
"MAGNET"
RTN
LBL 15
"MODERN"
RTN
LBL 16
"MINUTE"
RTN
LBL 17
"NATION"
RTN
LBL 18
"NORMAL"
RTN
LBL 19
"PLANET"
RTN
LBL 20
"POSTER"
RTN
LBL 21
"PERSON"
RTN
LBL 22
"SYSTEM"
RTN
LBL 23
"TALENT"
RTN
LBL 24
"WINTER"
END
Attachments
22_WO_Wortraten.raw
(383 Bytes) Downloaded 8 times
My programmable calculators - former: CBM PR100, HP41CV, HP28S, HP11C - current: HP48G(+), HP35S, DM41X, DM42
Post Reply