The Hidden Word
DATA holds a word, underscores hide it — the player guesses one letter at a time.
A word hides behind underscores. The player reveals it one letter at a time.
Line 120 stores a word in DATA. Line 200 reads it into w$. Lines 210–220 build a display string d$ — the same length as the word, but all underscores. Line 290 prints each character of d$ with spaces between them, so the player can count the letters.
Line 400 asks for a guess — and converts it to a capital. The Spectrum types lowercase by default, but the word is stored in capitals, so IF g$ >= "a" AND g$ <= "z" THEN LET g$ = CHR$ (CODE g$ - 32) shifts a lowercase letter up to its capital: CODE gives a character's number, every capital sits 32 below its lowercase, and CHR$ turns the number back into a letter. Now s and S both match. Lines 480–500 are the core: a FOR loop walks through every character of the word. If the character matches the guess, LET d$(i TO i) = g$ replaces that underscore with the actual letter. Line 550 loops back to show the updated display.
String indexing
You read string slices in Hi-Lo — f$(v TO v) pulled out one card's letter. Here the slice does the opposite: it writes. d$(i TO i) = g$ replaces a single character inside a string — d$(3 TO 3) = "E" puts an E in the third position. The TO syntax cuts the same section whether you are reading it or assigning to it. The FOR loop on lines 480–500 uses this to check every position: if position i of the word matches the guess, position i of the display string changes from _ to that letter. Reading a slice you knew; writing one is the new move, and it is the whole reveal mechanic.
The word w$ never changes. The display d$ is a separate string that starts as all underscores and gradually fills in. When every underscore is replaced, the player has guessed the whole word.
Run it. Type a letter — upper or lower case, it does not matter. If it is in the word, the underscore at that position reveals itself. The word is always "SPECTRUM" for now — that changes later.