Word Play II is a multi-player word game collection offering three distinct games—Anagrams, Hangman, and Jumble—for two to six players. The Anagrams mode has one player secretly enter a word, which the program then shuffles using a random placement algorithm, and the next player guesses letters one at a time. Hangman renders a gallows and figure using user-defined graphics (UDGs) and tracks guessed letters against a 26-character string. Jumble deals each player seven random letters (four consonants from a weighted pool and three vowels) and scores their word attempt based on both length and elapsed time, read from the system frame counter via PEEKs at addresses 23672–23673. The program includes an animated logo sequence, player name entry with capitalization normalization, a function-key input validator defined with DEF FN, and an error handler using ON ERR that attempts recovery and falls back to tape verification.
Program Analysis
Program Structure
The program is organized into well-separated subroutine blocks, each prefaced by a REM comment. The main loop at lines 100–170 calls three initialization subroutines and then dispatches to a game-selection routine. Game logic is grouped as follows:
- Lines 2000–2020: Animated logo/title sequence
- Lines 2050–2810: Anagrams game
- Lines 4000–4550: Hangman game
- Lines 6050–6930: Jumble game
- Lines 5010–5430: Hangman drawing and win/lose sub-routines
- Lines 7000–7820: Jumble scoring and challenge sub-routines
- Lines 8000–8250: End-of-round and word-input utilities
- Lines 9230–9890: Setup routines (title display, player entry, game selection, turn rotation)
- Lines 9700–9710: DEF FN definitions
- Lines 9800–9850: Decorative box-drawing subroutine
- Lines 9900–9999: Save/load bootstrap and error recovery
Game Selection and Flow
After initialization, the subroutine at line 9600 presents the three game choices and dispatches via GO SUB to lines 2050, 4000, or 6050. Each game ends with a call to the end-of-round subroutine at line 8000, which queries whether to replay the same game with the same players. The variable k$ carries the “play again?” response and l$ carries the “same players?” response, with flow returning to the appropriate setup point.
Anagrams Algorithm
The word shuffler at lines 2200–2360 uses a two-pass approach. First (lines 2240–2280), it iterates through all but the last character of the input word, picks a random empty slot in the output array z$, and places the source character there, marking occupied slots with a block-graphic sentinel (\::, the filled-square character). Spaces in the input are pre-filled with the same sentinel so they maintain their positions. A second pass (lines 2290–2360) fills any remaining empty slot with the last character of the input, then converts sentinel values back to spaces. Line 2365 restarts the shuffle if the result equals the original word, preventing trivially solved anagrams.
Hangman UDG Graphics
The gallows and hanging figure in Hangman rely heavily on UDG characters referenced as \a through \p (and others). The subroutine at line 5010 draws the complete structure, with lines 5010–5020 providing two variants for the figure’s legs (dangling vs. still). The animated “game over” sequence at lines 4430–4490 alternates between two display states using the flag variable e, toggling the figure position to create a swinging effect. The “saved” animation at lines 5400–5430 presents a contrasting celebratory display when the player wins.
Jumble Timing Mechanism
The Jumble game scores players on both word length and speed. Time is measured using the system frame counter at addresses 23672 (low byte) and 23673 (high byte), wrapped in the function FN t() defined at line 9700:
DEF FN t()=INT ((256*PEEK 23673+PEEK 23672)/50)
The counter is reset before input with POKE 23672,0: POKE 23673,0 at line 6550. Two readings are taken after input (lines 6600–6606) and the larger is used, compensating for counter wraparound. The score formula at line 6630 is INT(10*LEN a$ - t/2), positive only when 20*LEN a$ > t, so longer words allow more time before scoring is penalized.
Letter Pool and Jumble Deal
The letter distribution in Jumble simulates natural language frequency. The consonant pool c$ at line 6100 is a 55-character string with letters weighted by approximate English frequency (e.g., six R’s, five T’s, four L’s and N’s). The vowel pool v$ at line 6110 has 14 characters favoring A and E. Each deal gives a player four consonants and three vowels, selected by random indexing into these pools.
DEF FN Usage
Two user-defined functions are declared at lines 9700 and 9710:
FN t()— reads the frame counter and converts to seconds (described above)FN k$(k$,i$,j$)— a two-choice key validator that accepts either case of two allowed characters, returning the matched character or an empty string. This is used throughout to accept Y/N and A/C responses cleanly.
Player Name Normalization
The name entry routine at lines 9480–9520 enforces title-case formatting: the first character of the name and any character following a space is uppercased; all other alphabetic characters are lowercased. Non-alphabetic, non-space characters (other than valid letters) cause the name to be rejected and re-entered. Names are stored in the dimensioned string array n$(n,12), truncating to 12 characters.
Turn Rotation
Player rotation is managed by the subroutine at lines 9860–9890, which increments both p1 (active player) and p2 (watching player), wrapping both back to 1 when they exceed n. This means in a two-player game, p1 and p2 always differ by one; in larger games, they remain adjacent in the rotation.
Error Handling and Tape Bootstrap
Line 15 installs an ON ERR handler pointing to line 9990, which chains through RESET, a 100-frame pause, and ON ERR CONTINUE in sequence, attempting graceful recovery from runtime errors. The bootstrap block at line 9900 uses CLEAR, saves the BASIC with auto-run, saves a machine-code block from USR "a" for 168 bytes, and the loader at 9902–9903 reloads the code block and calls the logo subroutine before running. Line 9999 performs a double VERIFY to confirm tape integrity.
Notable Techniques and Idioms
- Boolean string expressions like
("s" AND ng>1)for conditional plural suffixes (line 2720) - Ordinal suffix selection using string concatenation of four boolean terms at line 2560 (“st”, “nd”, “rd”, “th”)
- Tracking which letters have been tried in Hangman using a 26-character string
T$indexed byCODE K$-64, with tried letters overwritten with"*"(lines 4275–4348) POKE 23692,255at lines 4095 and 4125 to suppress the automatic scroll prompt- The
s$variable (eight spaces, line 50) used as a padding/clearing string throughout PRINT statements - Case normalization via
CODE k$-32comparisons andCHR$arithmetic appears in multiple input routines rather than a shared function - The Jumble challenge mechanic at lines 7600–7690 allows any player to contest a submitted word, with a Y/N ruling that zeroes the score if rejected
Anomalies and Minor Issues
- Line 6930 uses
GO TO 6000, but line 6000 does not exist in the listing; the nearest valid line is 6050. This would cause an error on replay, though the ON ERR handler may mask it in practice. - The Jumble word validation at lines 6680–6760 checks each letter of the player’s word against the dealt letters, marking matches with
"+"and"@". However, thek=7assignment inside the FOR loop at line 6715 is used to break out of the inner loop early — a common workaround in BASIC lacking a structured exit. - Line 6780 is referenced by
GO TO 6780at line 7710 but does not appear explicitly in the listing; execution would fall through to line 6790 naturally in normal flow, but the branch target is technically absent. - The
z$variable is reused for different purposes across the three games (anagram output array, Jumble consonant draw buffer, and temporary character in name entry), which is valid but could cause confusion when tracing the code.
Content
Source Code
10 REM Wordplay2
15 ON ERR GO TO 9990
20 REM RESET Fisher-Marriott 1982
30 REM ZX Spectrum - 48K
40 REM 1/83
50 LET s$=" "
80 CLS : INK 9
100 GO SUB 9230
110 GO SUB 9400
150 GO SUB 9600
160 IF l$="n" THEN GO TO 110
170 GO TO 150
1999 REM LOGO
2000 BORDER 5: PAPER 5: CLS : INK 9: CIRCLE 128,115,56
2001 LET p=72: FOR i=115 TO 170
2002 IF POINT (p,i) THEN PLOT p,i: DRAW 2*(128-p),0: BEEP .01,p-72: PLOT p,230-i: DRAW 2*(128-p),0: BEEP .01,p-72: GO TO 2004
2003 LET p=p+1: GO TO 2002
2004 NEXT i
2005 BRIGHT 1: FOR j=4 TO 8: PRINT AT j,11;" \::\::\::\::\ \::\ \::\ ": NEXT j
2006 PRINT AT 4,12;"\..\..\..\::\ \..\ \..";AT 6,12;"\..\..": PAPER 8: INK 9: BRIGHT 0
2007 PRINT AT 10,15;"-": PAPER 5: FOR J=0 TO 7
2008 PRINT AT 10,j;" FISHER";AT 10,24-j;"MARRIOTT"; PAPER 5;" ": BEEP .1,42-6*j: BEEP .1,39-6*j: NEXT j
2009 PRINT AT 10,8;" FISHER-MARRIOTT";" "
2010 PRINT AT 12,13;"\* 1983"
2012 PRINT AT 16,0;" \: \: \: \: \r\''\s\t ";
2014 PRINT " \: \: \r\s\t\q\' \r\s\: \q\s\t\: \r\s\: \: \: \: ";
2016 PRINT " \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \r\''\''\' ";
2017 PRINT " \o\p\o\p\c\o\p\c\: \o\p\: \u\p\c\: \o\p\: \o\p\: \:.\..\..\. ";
2018 PRINT " \: \o\p\c "
2020 BEEP 1,-24: FOR i=1 TO 400: NEXT i: RETURN
2049 REM ANAGRAMS
2050 LET P1=0
2060 LET P2=1
2070 FOR l=1 TO n
2080 GO SUB 9860
2100 GO SUB 9800
2110 PRINT "ANAGRAMS"
2120 PRINT PAPER 7;AT 6,0;"In this game one player enters a";"word.";TAB 32;"The computer then jumbles the letters up.";TAB 32;"The next player has to guess theword.";TAB 32
2150 GO SUB 8200
2160 IF LEN a$>27 THEN PRINT "The word was TOO LONG-try again!": GO SUB 8210: GO TO 2160
2180 CLS : PRINT AT 8,12; PAPER 1;"EXCUSE ME";AT 9,12;" WHILE I ";AT 10,12;"THINK FOR";AT 11,12;"A MOMENT"
2205 DIM z$(LEN a$)
2210 FOR a=1 TO LEN a$: BEEP .1,20+RND*a*2-a
2220 IF a$(a)=" " THEN LET z$(a)="\::"
2230 NEXT a
2240 FOR a=1 TO LEN a$-1: BEEP .1,20+RND*a*2-a
2250 LET z=INT ((LEN z$)*RND+1)
2260 IF z$(z)<>" " THEN GO TO 2250
2270 LET z$(z)=a$(a)
2280 NEXT a
2290 FOR a=1 TO LEN a$: BEEP .1,20+RND*a*2-a
2300 IF z$(a)=" " THEN LET z$(a)=a$(LEN a$)
2310 IF z$(a)="\::" THEN LET z$(a)=" "
2360 NEXT a
2365 IF z$=a$ AND LEN a$>1 THEN GO TO 2200
2370 CLS
2400 LET a=16-(LEN z$)/2
2405 FOR z=0 TO 8 STEP 8
2410 FOR j=a-2 TO a+LEN z$+1
2420 PRINT AT 2+z,j;"\u";AT 6+z,j;"\q"
2430 NEXT j
2440 FOR j=3 TO 5
2450 PRINT AT j+z,a-2;" ";TAB a+LEN z$+1;" "
2460 NEXT j
2470 PRINT AT 4,a; INK 0; PAPER 7;z$
2480 NEXT z
2490 PRINT AT 12,a;
2500 FOR j=1 TO LEN z$
2510 PRINT PAPER 7;("#" AND z$(j)<>" ")+(" " AND z$(j)=" ");
2520 NEXT j
2530 PRINT AT 17,0;"Guess the letter,";TAB 52;n$(p2)
2540 LET ng=0: LET j1=1
2550 FOR j=1 TO LEN z$
2555 IF a$(j)=" " THEN NEXT j
2560 PRINT PAPER 7;AT 17,10;j1;("st" AND (j=1 OR j=21))+("nd" AND (j=2 OR j=22))+("rd" AND (j=3 OR j=23))+("th" AND j>=4 AND j<>21 AND j<>22 AND j<>23): BEEP .2,12
2570 PRINT AT 20,0;"Number of WRONG guesses:";ng
2580 PRINT AT 12,a+j-1;"#"
2610 LET k$=INKEY$: IF k$="" THEN GO TO 2610
2615 LET k$=CHR$ (CODE k$-32*(CODE k$>96))
2620 IF k$<>a$(j) THEN PRINT AT 12,a+j-1; PAPER 2;k$;: BEEP .1,6: BEEP .5,0: LET ng=ng+1
2625 IF INKEY$>"" THEN GO TO 2625
2630 IF k$<>a$(j) THEN GO TO 2570
2635 PRINT PAPER 1;AT 12,a+j-1;a$(j);
2640 FOR k=1 TO 5: BEEP .1,k*5: NEXT k: BEEP .2,30
2645 FOR k=1 TO LEN z$: IF z$(k)<>"\::" AND z$(k)=a$(j) THEN LET z$(k)="\::": LET k=LEN z$
2647 NEXT k: PRINT PAPER 7;AT 4,a;z$; PAPER 5;AT 12,a+j-1;a$(j);
2650 LET j1=j1+1: NEXT j
2710 PRINT AT 16,0,,,,,,
2720 IF ng>0 THEN PRINT "Anagram";TAB 28;"WellSolved In ";ng;" Attempt"+("s" AND ng>1);TAB 28;"Done"
2730 IF ng=0 THEN PRINT " CONGRATULATIONS, ";n$(p2);" Solved at the first attempt "
2740 FOR j=1 TO 350: IF INKEY$>"" THEN LET j=350
2750 NEXT j
2760 CLS : NEXT l
2780 GO SUB 8000
2790 IF k$="n" THEN RETURN
2800 IF l$="n" THEN GO SUB 9400
2810 GO TO 2050
3999 REM HANGMAN
4000 LET p1=0
4005 CLS
4010 LET p2=1
4020 FOR l=1 TO n
4030 LET c$=""
4040 LET lv=9
4050 LET b=0
4060 GO SUB 9860
4070 GO SUB 9800
4080 PRINT "HANGMAN"
4090 GO SUB 5000
4095 POKE 23692,255
4100 PRINT "In this game one player enters ","a word";TAB 32
4110 PRINT "The next player must guess it before he comes to a sticky end."
4120 FOR a=1 TO 200: NEXT a
4125 POKE 23692,255: PRINT ''''''''
4180 GO SUB 8200
4190 GO SUB 9800
4200 PRINT "HANGMAN"
4210 PRINT AT 8,0;"Try to"'"guess"'"this,"'n$(p2): BEEP .2,24
4220 PRINT AT 17,16-LEN a$;
4230 IF LEN a$>16 THEN PRINT AT 17,16-LEN a$/2;
4240 FOR a=1 TO LEN a$
4250 PRINT (" " AND a$(a)=" ")+("*" AND a$(a)<>" ")+(" " AND LEN a$<=16);
4252 BEEP .05,0: PRINT CHR$ 8+(CHR$ 8 AND LEN a$<=16);
4254 PRINT (" " AND a$(a)=" ")+("*" AND a$(a)<>" ")+(" " AND LEN a$<=16);
4260 LET c$=c$+" "
4270 NEXT a
4275 LET T$="ABCDEFGHIJKLMNOPQRSTUVWXYZ"
4278 PRINT AT 13,0;"Try a letter";
4280 LET k$=INKEY$
4282 IF k$="" THEN GO TO 4280
4283 IF k$<"A" OR k$>"z" THEN GO TO 4280
4284 IF k$>"Z" AND k$<"a" THEN GO TO 4280
4285 IF CODE k$>96 THEN LET k$=CHR$ (CODE k$-32)
4290 PRINT AT 13,0;" "
4300 PRINT AT 20,0;"You've"'"tried:";
4320 LET B=B+1
4330 LET C=0
4332 IF T$(CODE K$-64)="*" THEN LET b=b-1: PRINT AT 19,0;"You have already had ";k$: FOR a=1 TO 150: NEXT a: PRINT AT 19,0;" ": GO TO 4380
4340 PRINT PAPER 7;AT 20+(B>13),5+2*B-26*INT (B/14);k$
4348 LET T$(CODE K$-64)="*"
4350 FOR A=1 TO LEN A$
4360 IF k$=a$(a) THEN GO SUB 5200
4370 NEXT a
4380 IF c=0 THEN BEEP .1,0: BEEP .4,-6: LET lv=lv-1
4390 GO SUB 5010+10*lv
4400 IF c$=a$ THEN PRINT AT 17,0,,,,,,,,,, PAPER 2;AT 21,16-LEN c$/2;c$: GO TO 4500
4410 IF INKEY$>"" THEN GO TO 4410
4420 IF lv<>0 THEN GO TO 4278
4425 LET e=0
4428 PRINT AT 17,0,,
4430 FOR a=1 TO 50
4435 PRINT AT 8,0;" +TOO+"; PAPER 8;AT 9,0;" +BAD+"; PAPER 8;AT 10,0;" ";AT 11,0;" \r \d ";AT 12,1;" OO ";AT 13,1; PAPER 8;"\':.."; PAPER 8;"\:'";AT 14,2;"""""";AT 16,0; PAPER 8;" R+I+P"
4438 IF E THEN BEEP .01,0: BEEP .01,6: BEEP .01,12: BEEP .01,18: BEEP .01,24
4440 PRINT AT 8,18;"\b";AT 9,18;("\b" AND e=0)
4450 PRINT AT 10-e,17;" \a ";AT 11-e,17;"\r:\d";AT 12-e,17;"\e \f";AT 13-e,17;" \g ";AT 14-e,17;" \h ";AT 15-e,17;"\i\j\k";AT 16-e,17;" "
4460 PRINT BRIGHT 1; PAPER 7;AT 17,16-LEN A$/2;(A$ AND NOT E)+(C$ AND E)
4470 LET e=1 AND e=0
4490 NEXT a
4500 IF c$=a$ THEN GO SUB 5400
4510 CLS : NEXT l
4520 GO SUB 8000
4530 IF k$="n" THEN RETURN
4540 IF l$="n" THEN GO SUB 9400
4550 GO TO 4000
5010 PRINT AT 12,18;"\g";AT 13,18;"\h";AT 14,17;"\i\j\k": GO TO 5030
5020 PRINT AT 12,18;"\l";AT 13,18;"\m";AT 14,17;"\i\n"
5030 PRINT AT 10,19;"\d";AT 11,19;"\f"
5040 PRINT AT 10,17;"\r";AT 11,17;"\e"
5050 PRINT AT 10,18;":";AT 11,18;" "
5060 PRINT AT 7,18;"\b";AT 8,18;"\b";AT 9,18;"\a"
5070 PRINT AT 6,14;"\:'\..\..\..\.."
5080 PRINT AT 7,14;"\ :\q\''";AT 8,14;"\ :\' ";AT 9,14;"\ :"
5090 PRINT AT 10,14;"\ :";AT 11,14;"\ :";AT 12,14;"\ :";AT 13,14;"\ :";AT 14,14;"\ :";AT 15,14;"\.:\. ";AT 16,13;"\p\::\u\. "
5100 RETURN
5200 PRINT AT 17,(LEN a$<=16)*(14-LEN a$+2*a)+(LEN a$>16)*(15-LEN a$/2+a);"";k$;"": BEEP .2,24
5205 PRINT AT 17,(LEN a$<=16)*(14-LEN a$+2*a)+(LEN a$>16)*(15-LEN a$/2+a);k$;
5210 LET c=1
5220 LET c$(a)=a$(a)
5230 RETURN
5400 FOR I=0 TO 10: BEEP .15,0+3*I: NEXT I: PRINT AT 8,0;"*SAVED*";AT 9,0;"FROM A";AT 10,0;"CERTAIN";AT 11,0;"+DEATH+"; PAPER 8;" ": BEEP .5,33
5405 PRINT PAPER 8;AT 12,0;" ";AT 13,0;" \r \d ";AT 14,1;" OO ";AT 15,1; PAPER 8;"\':.."; PAPER 8;"\:'";AT 16,2;""""""
5410 FOR J=1 TO 250: IF INKEY$>"" THEN LET J=250
5420 NEXT J
5430 RETURN
6050 GO SUB 9800
6052 PRINT " JUMBLE "
6055 PRINT AT 5,0'"In this game each player is","given 7 letters in turn.";TAB 32;''"The aim is to make as long a word as possible,as fast as","possible.";TAB 32
6057 PRINT '" ENTER YOUR TARGET SCORE, E.G.:"'''" 2for 200 5 for 500 9 for 900 "
6059 PRINT ''TAB 8;"PRESS A NUMBER"
6060 LET K$=INKEY$
6070 IF K$<"1" OR K$>"9" THEN GO TO 6060
6080 LET tot=100*VAL k$
6090 PRINT AT 21,6;"";tot;"";" is your target."
6100 LET c$="BBCCDDDDFFGGGHHJKLLLLMMNNNNNNPPRRRRRRSSSSTTTTTTVVWWXYYZ"
6110 LET v$="AAAEEEEIIIOOOU"
6120 DIM s(n)
6130 LET p1=0: LET p2=1
6150 FOR j=1 TO 200
6160 NEXT j
6165 CLS : GO SUB 9800: PRINT " JUMBLE ": PRINT AT 17,0;"\p\p\p\p\p\p\p\p\p SCORES \p\p\p\p\p\p\p\p\p\p\::";TAB 31;"\::\::";TAB 31;"\::\::";TAB 31;"\::\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s"
6170 FOR i=6 TO 16: PRINT AT i,0;TAB 31;" ": NEXT i
6220 DIM Z$(3): DIM Y$(4)
6360 FOR J=1 TO n
6370 PRINT BRIGHT 1;AT 17+j-3*(j>3),1+15*(j>3);n$(j);" " AND s(j)<100;" " AND s(j)<10;"";s(j);"": NEXT j
6390 LET s=0
6410 FOR j=8 TO 12
6415 PRINT AT j,0;s$;AT j,23;s$
6420 NEXT j
6430 PRINT AT 6,0
6440 GO SUB 9800
6450 GO SUB 9860
6460 PRINT AT 13,0;" It's your turn, ";n$(p1);""
6470 PRINT AT 9,12;
6480 FOR j=1 TO 4: LET y$(j)=c$(INT (RND*55)+1): NEXT j
6490 FOR j=1 TO 3: LET z$(j)=v$(INT (RND*14)+1): NEXT j
6530 PRINT PAPER 7;y$+z$
6540 PRINT AT 15,2;" Make a word, and press ENTER"
6550 POKE 23672,0: POKE 23673,0
6570 INPUT LINE a$: BEEP .01,24: IF a$="" THEN GO TO 6570
6590 LET b$=a$
6600 LET t=FN t()
6604 LET t1=FN t()
6606 IF t1>t THEN LET t=t1
6610 BEEP .01,24: PRINT PAPER 6;AT 13,0;s$+" Chosen by "+n$(p1)+" ";AT 13,0;""""+a$+""""
6630 LET s=INT (10*LEN a$-t/2)*(20*LEN a$>t)
6635 IF s=0 THEN GO TO 7700
6640 PRINT AT 7,24;" TIME ";AT 8,24;" ";AT 9,24;" ";t;" "+(" " AND t<10)+(" " AND t<100);AT 10,24;" secs ";AT 11,24;" "
6650 PRINT AT 7,0;"POSSIBLE";AT 8,0;" SCORE ";AT 9,0;" ";AT 10,0;" "+(" " AND S<10);S;" ";AT 11,0;" "
6660 LET t$=y$+z$
6680 FOR j=1 TO LEN a$
6685 IF CODE a$(j)>96 THEN LET a$(j)=CHR$ (CODE a$(j)-32)
6697 FOR k=1 TO 7
6698 IF a$(j)<>t$(k) THEN GO TO 6720
6700 LET a$(j)="+"
6710 LET t$(k)="@"
6715 LET k=7
6730 NEXT k
6740 PRINT AT 16,15;" "
6750 IF a$(j)<>"+" THEN GO SUB 7000
6760 NEXT j
6790 GO SUB 7400+400*(s=0)
6800 IF s(p1)>=tot THEN PRINT AT 12,0;TAB 31;" ";TAB 32;"The winner!\.'\.'\.'\.'\.'"+S$+S$;AT 14,17;"";N$(P1);" ";: FOR l=1 TO 8: BEEP .1,12+2*l: NEXT l: BEEP .5,30: PRINT '"WELL DONE!\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'\.'"'TAB 31
6850 FOR J=1 TO 400: NEXT J
6870 IF s(p1)<tot THEN GO TO 6170
6900 GO SUB 8000
6910 IF k$="n" THEN RETURN
6920 IF l$="n" THEN GO SUB 9400
6930 GO TO 6000
7000 LET f=0: IF a$(j)="U" THEN GO SUB 7200
7010 IF f THEN GO TO 7020
7015 BEEP .5,0: PRINT AT 14,2;"A wrong letter, ";n$(p1)
7020 LET s=0
7040 LET j=LEN a$
7190 RETURN
7200 FOR l=1 TO 7
7210 IF t$(l)="V" THEN PRINT AT 14,2;"Don't mix up ""V"" and ""U"" ": LET f=1: LET L=7
7230 NEXT L: RETURN
7410 PRINT AT 15,0;" If word is agreed, PRESS ""A""If word is challenged, PRESS ""C"""
7420 LET k$=FN k$(INKEY$,"a","c")
7430 IF k$="" THEN GO TO 7420
7440 IF k$="c" THEN GO SUB 7600
7450 IF s>0 THEN BEEP .1,12: BEEP .1,14: BEEP .5,22: PRINT AT 15,0;s$+s$+s$+s$+s$+"WORD IS ACCEPTED"+S$
7460 LET s(p1)=s(p1)+s
7470 PRINT BRIGHT 1;AT 17+p1-3*(p1>3),13+15*(p1>3);" " AND s(p1)<100;" " AND s(p1)<10;"";S(p1)
7590 RETURN
7600 BEEP .5,0: PRINT AT 13,0;s$+"HAS BEEN CHALLENGED: ";AT 13,0;"";b$
7610 PRINT '"PRESS ""N""if the word IS nonsense"
7620 PRINT "PRESS ""Y""if the word is alright "
7630 LET k$=FN k$(INKEY$,"y","n")
7640 IF k$="" THEN GO TO 7630
7660 IF k$="y" OR k$="Y" THEN RETURN
7670 LET s=0
7680 BEEP .2,0: BEEP .5,-6: PRINT AT 10,3;" 0";AT 15,0;"Sorry,word rejected,"+n$(p1);AT 16,0;"NO SCORE";TAB 32
7690 RETURN
7700 IF s=0 THEN BEEP .2,0: BEEP .5,-6: PRINT AT 13,0;"You took too long,"+n$(p1)+" "
7710 GO TO 6780
7800 BEEP .2,0: BEEP .5,-6: PRINT AT 15,0;s$+" NO SCORE "+S$
7820 RETURN
8000 CLS
8010 GO SUB 9800
8020 PRINT PAPER 7;("ANAGRAMS" AND G$="1")+("HANGMAN" AND G$="2")+(" JUMBLE " AND G$="3")
8030 PRINT AT 8,10;"END OF ROUND"
8090 PRINT AT 11,0;"Do you want to play Y =Yes","the same game again? N =No "
8100 LET k$=INKEY$: IF k$<>"y" AND k$<>"Y" AND k$<>"n" AND k$<>"N" THEN GO TO 8100
8120 LET k$=CHR$ (CODE k$+(32*CODE k$<91))
8125 IF INKEY$>"" THEN GO TO 8125
8130 PRINT '" Same Y =Yes","players? N =No "
8140 LET l$=INKEY$: IF l$<>"y" AND l$<>"Y" AND l$<>"n" AND l$<>"N" THEN GO TO 8140
8150 LET l$=CHR$ (CODE l$+(32*CODE l$<91))
8160 CLS : RETURN
8200 PRINT ''"Now for the "+("first" AND l=1)+("next" AND l>1)+" turn"
8210 PRINT ''"Shut your eyes, ";n$(p2);''"Enter a word, ";n$(p1);" ";
8220 PRINT ''("NO CHEATING, "+n$(p2) AND RND>.8)
8230 LET f=0: INPUT LINE a$: IF LEN a$<3 OR LEN a$>32 THEN GO TO 8230
8240 FOR i=1 TO LEN a$: IF a$(i)<"A" OR a$(i)>"z" THEN LET f=1
8241 IF a$(i)>"Z" AND a$(i)<"a" THEN LET f=1
8242 IF a$(i)=" " THEN LET f=0
8243 IF f THEN LET i=LEN a$: GO TO 8246
8245 IF CODE a$(i)>96 THEN LET a$(i)=CHR$ (CODE a$(i)-32)
8246 NEXT i: IF f THEN GO TO 8230
8247 IF LEN a$<3 OR LEN a$>32 THEN GO TO 8240
8250 CLS : RETURN
9230 PRINT "";TAB 31;" \: \: \: \: \r\''\s\t "
9240 PRINT " \: \: \r\s\t\q\' \r\s\: \q\s\t\: \r\s\: \: \: \: "
9250 PRINT " \: \: \: \: \: \: \: \: \: \: \: \: \: \: \: \r\''\''\' "
9260 PRINT " \o\p\o\p\c\o\p\c\: \o\p\: \u\p\c\: \o\p\: \o\p\: \:.\..\..\. "
9270 PRINT " \: \o\p\c "
9280 FOR j=1 TO 150: IF INKEY$>"" THEN LET j=150
9290 NEXT j
9340 PRINT '"\* Fisher-Marriott 1983"
9350 PRINT '" WORD GAMES FOR 2 TO 6 PLAYERS: "
9360 PRINT '"ANAGRAMS, HANGMAN AND "" JUMBLE """
9370 RETURN
9400 PRINT ''"How many players, please?";
9420 LET k$=INKEY$
9430 IF k$<"2" OR k$>"6" THEN GO TO 9420
9440 LET n=VAL k$
9450 DIM n$(n,12)
9460 PRINT " ";n
9470 PRINT '';"Enter your names, please"''
9480 FOR j=1 TO n: PRINT "Player ";j;") ";
9490 INPUT LINE y$
9491 LET fn=0: FOR k=1 TO LEN y$: LET z$=y$(k)
9493 IF z$=" " THEN GO TO 9509
9494 IF z$<"A" OR z$>"z" THEN GO TO 9508
9495 IF z$>"Z" AND z$<"a" THEN GO TO 9508
9496 IF k=1 THEN LET z$=CHR$ ((CODE z$)-32*(z$>"Z")): GO TO 9509
9497 IF y$(k-1)=" " THEN LET z$=CHR$ ((CODE z$)-32*(z$>"Z")): GO TO 9509
9498 LET z$=CHR$ ((CODE z$)+32*(z$<"a")): GO TO 9509
9508 LET k=LEN y$: LET fn=1
9509 LET y$(k)=z$: NEXT k: IF fn THEN GO TO 9490
9510 LET n$(j)=y$: IF n$(j)=" " THEN GO TO 9490
9520 PRINT n$(j): NEXT j
9550 CLS : RETURN
9600 PRINT ''"PLEASE CHOOSE A GAME."
9610 PRINT '"1 = ANAGRAMS"''"2 = HANGMAN "''"3 = JUMBLE "'''';"PRESS A NUMBER"
9630 LET g$=INKEY$: IF g$<"1" OR g$>"3" THEN GO TO 9630
9640 CLS
9645 IF g$="1" THEN GO SUB 2050
9650 IF g$="2" THEN GO SUB 4000
9655 IF g$="3" THEN GO SUB 6050
9660 CLS : RETURN
9700 DEF FN t()=INT ((256*PEEK 23673+PEEK 23672)/50)
9710 DEF FN k$(k$,i$,j$)=(i$ AND (k$=i$ OR k$=CHR$ (CODE i$-32)))+(j$ AND (k$=j$ OR k$=CHR$ (CODE j$-32)))
9800 PRINT TAB 10;"\::\u\p\u\p\u\p\u\p\u\p\::"
9810 FOR k=1 TO 3: PRINT TAB 10;"\::";TAB 21;"\::"': NEXT k
9830 PRINT TAB 10;"\::\q\s\q\s\q\s\q\s\q\s\::": PRINT AT 2,12;
9850 RETURN
9860 LET p1=p1+1
9870 IF p1>n THEN LET p1=1
9880 LET p2=p2+1: IF p2>n THEN LET p2=1
9890 RETURN
9900 CLEAR : SAVE "wordplay2" LINE 9902: SAVE " "CODE USR "a",168: STOP
9902 LOAD ""CODE
9903 GO SUB 2000: RUN
9990 ON ERR RESET
9991 PAUSE 100
9992 ON ERR GO TO 9990
9993 ON ERR CONTINUE
9999 VERIFY "": VERIFY ""CODE
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.

