50 RANDOMIZE TIMER
100 PRINT:PRINT:PRINT:PRINT "HELLO. WHAT IS YOUR NAME";:INPUT N$
110 PRINT "HI ";N$;". THIS IS THE GAME KNOWN AS HANGMAN. DO YOU KNOW" 
120 PRINT "HOW TO PLAY ";:INPUT Y$ 
130 IF Y$="YES" THEN 210 
140 IF Y$ ="NO" THEN 160 
150 PRINT "JUST A YES OR NO WILL DO JUST FINE HERE. ";:INPUT Y$:GOTO130 
160 PRINT "I THINK OF A WORD, AND YOU GUESS THE LETTERS IN THE WORD."
170 PRINT "YOU HAVE 10 GUESSES. IF YOU GUESS THE CORRECT WORD, YOU" 
180 PRINT "WIN. IF NOT, YOU HANG. CORRECT LETTER GUESSES WILL NOT AFFECT" 
190 PRINT "YOUR COUNTER. YOU MAY SURRENDER AT ANY TIME BY TYPING IN AN" 
200 PRINT "ASTERISK (*). WE ARE NOW READY TO BEGIN." 
210 PRINT "THIS IS THE AVERAGE VOCABULARY GAME":PRINT:PRINT 
220 DIM V(20) 
230 DIM B(20) 
240 DIM C$(20),G$(20),B$(40) 
250 DIM F(10),O$(10),Q$(20) 
260 DIM A(20),H(1) 
270 DIM W$(20) 
280 PRINT "LET'S PLAY HANGMAN." 
290 GOSUB 1450 
300 PRINT L$
310 W7$="IES" 
320 L7$="S."
330 H(0)=1 
340 RESTORE 
350 FOR I=1 TO 10: READ F(I):NEXT 
360 FOR I=1 TO 10: READ O$(I):NEXT 
370 READ N9 
380 LET N=0 
390 Q=0 
400 N2 = 0 
410 FOR J = 1 TO 20 
420 Q$(J) = " " 
430 NEXT J 
440 I=INT(N9*RND(1)+1) 
450 FOR J=1 TO I
460 READ A$ 
470 NEXT J 
480 A=LEN(A$) 
490 FOR I = 1 TO A 
500 G$(I)=MID$(A$,I,1) 
510 W$(I)=G$(I)
520 NEXT I 
530 A=LEN(A$) 
540 FOR J=1 TO 20 
550 C$(J)="-" 
560 NEXT J 
570 X=10 
580 N=1
590 N1=0 
600 REM DON"T PRINT GUESSES
610 IF Q=1 THEN 670 
620 PRINT "THE WORD IS "; 
630 FOR J=1 TO A 
640 PRINT C$(J);" "; 
650 NEXT J 
660 PRINT L$ 
670 Q=0
680 PRINT "GUESS"; 
690 INPUT G1$ 
700 IF G1$="*" THEN 1260 
710 IF G1$=A$ THEN 1240
720 FOR K=1 TO A 
730 IF G1$=G$(K) THEN 890 
740 NEXT K 
750 FOR L=1 TO N 
760 IF G1$><B$(L) THEN 790
770 PRINT "NO...YOU TRIED THIS BEFORE."
780 GOTO 810 
790 NEXT L 
800 PRINT "NO" 
810 X = X - 1 
820 N2 = N2 + 1
830 Q=1
840 Q$(F(N2))=O$(N2) 
850 IF X=0 THEN 1200 
860 GOSUB 1440 
870 GOSUB 1000 
880 GOTO 970 
890 PRINT "HEY, THAT""S RIGHT!!!!!"
900 FOR L=K TO A 
910 IF G$(L)><G1$ THEN 950
920 C$(L)=G1$ 
930 G$(L)="=,$*):" 
940 N1=N1+1
950 NEXT L 
960 GOSUB 1000 
970 IF N1=A THEN 1240 
980 IF X=0 THEN 1200 
990 GOTO 600 
1000 V=LEN(G1$) 
1010 IF V<1 THEN 1140 
1020 N = N + 1 
1030 LET B(N)=ASC(G1$) 
1040 B$(N)=G1$ 
1050 FOR I=1 TO N-1 
1060 IF B(N-I+1)>=B(N-I) THEN 1130 
1070 G1$=B$(N-I)
1080 B$(N-I)=B$(N-I+1) 
1090 B$(N-I+1)=G1$ 
1100 A5=B(N-I) 
1110 B(N-I)=B(N-I+1)
1120 B(N-I+1)=A5
1130 NEXT I 
1140 PRINT "YOU HAVE USED ";
1150 FOR L=1 TO N 
1160 PRINT B$(L); 
1170 NEXT L 
1180 PRINT ". ";
1190 RETURN 
1200 PRINT "YOU HAVE BEEN HUNG!"
1210 L8=L8+1
1220 GOSUB 1440 
1230 GOTO 1260 
1240 PRINT "YOU WIN"
1250 W8=W8+1
1260 PRINT "THE WORD WAS "; 
1270 FOR J=1 TO A 
1280 PRINT W$(J); 
1290 NEXT J 
1300 REM
1310 PRINT:PRINT "DO YOU WANT TO TRY ANOTHER WORD ";N$;"." 
1320 INPUT T$ 
1330 IF T$="YES" THEN 340 
1340 PRINT L$ 
1350 IF W8<>1 THEN 1370 
1360 W7$="Y"
1370 IF L8<>1 THEN 1390 
1380 L7$="."
1390 PRINT "WELL ";N$;"YOU RETIRE WITH A RECORD OF";W8;"VICTOR";W7$;" AND"; 
1400 PRINT L8;"DEFEAT";L7$ 
1410 IF W8>0 THEN 1420 
1420 PRINT "THANKS FOR PLAYING THE AVERAGE LEVEL OF HANGMAN." 
1430 END
1440 IF X>0 THEN 1570 
1450 PRINT "-----" 
1460 PRINT "I I" 
1470 FOR I = 1 TO 4 
1480 PRINT "I ";
1490 FOR J = 1 TO 5 
1500 PRINT Q$(5*(I-1)+J); 
1510 NEXT J 
1520 PRINT L$ 
1530 NEXT I 
1540 PRINT "I" 
1550 PRINT "--------" 
1560 RETURN 
1570 PRINT "YOU HAVE ";X;" MORE GUESSES." 
1580 RETURN 
1590 DATA 3,8,14,12,7,9,16,20,1,5 
1600 DATA "0","I","\","/","-","-","-","-","\","/" 
1610 DATA 180 
1620 DATA ABATE,ABERRATION,ABET,ABEYANCE,ABSTEMIOUS,ABSTRUSE: 
1630 DATA ACRIMONIOUS,ACUMEN,ADAMANT,AESTHETIC,AFFABLE,AGGRAVATE: 
1640 DATA AGNOSTIC,ALACRITY,ALLEGORY,ALLEVIATE,ALTERCATION,ALTRUISTIC: 
1650 DATA AMITY,ANACHRONISM,ANALOGY,ANATHEMA,APATHY,APOSTATE: 
1660 DATA APT,ARBITRARY,ASCETIC,ASKANCE,ASKEW,ASPERITY:
1670 DATA ASSIDUOUS,ASSUAGE,ATAVISM,AUGMENT,AUSPICIOUS,AUSTERE:
1680 DATA AUTHENTIC,AVARICE,AVERSE,AVID,BANAL,BELLICOSE: 
1690 DATA BENIGN,BIGOTED,BUCOLIC,BUMPTIOUS,CADAVEROUS,CAJOLE: 
1700 DATA CALLOUS,CALUMNY,CANDID,CANINE,CANTANKEROUS,CAPRICIOUS: 
1710 DATA CAPTIOUS,CAUSTIC,CHARLATAN,CHASTISE,CHIMERICAL,CIRCUMSPECT: 
1720 DATA CIRCUMVENT,CITE,CLANDESTINE,CLEMENT,COERCE,COGENT: 
1730 DATA COLLABORATE,COMELY,COMPATIBLE,CONCUR,CONDOLENCE,CONDONE: 
1740 DATA CONDUCIVE,CONJECTURE,CONNIVE,CONNOISSEUR,CONSTRUE,CONSUMMATE:
1750 DATA CONTRITE,CONTUMELY,CONVIVAL,COPIOUS,CORROBORATE,CREDENCE:
1760 DATA CUMBROUS,CURSORY,CURTAIL,DECORUM,DEFERENCE,DELETERIOUS: 
1770 DATA DEMUR,DEMURE,DEPRECATE,DERELICT,DEROGATORY,DESULTORY:
1780 DATA DEVIATE,DEVIOUS,DEXTEROUS,DIDACTIC,DIFFIDENT,DILATORY: 
1790 DATA DILEMMA,DILETTANTE,DISCOMFITURE,DISPARAGE,DISPARITY,DIVULGE: 
1800 DATA DOCILE,DOGMATIC,DRASTIC,DUPLICITY,EFFICACIOUS,EFFIGY:
1810 DATA EFFRONTERY,EGREGIOUS,ELIXIR,EMACIATED,EMANATE,EMOLUMENT: 
1820 DATA EMULATE,ENHANCE,ENIGMA,EPICURE,EPITAPH,EPITHET: 
1830 DATA EPITOME,EQUITABLE,EQUIVOCAL,ERODE,ERUDITE,ESOTERIC: 
1840 DATA ESTRANGE,EULOGY,EUPHONY,EXACERBATE,EXECRATION,EXIGENCY: 
1850 DATA EXONERATE,EXPATIATE,EXPATRIATE,EXPEDIENT,EXPIATE,EXPUNGE:
1860 DATA FALLIBLE,FATUOUS,FEASIBLE,FELICITOUS,FESTOON,FETISH: 
1870 DATA FIASCO,FILCH,FLUCTUATE,FOIBLE,FORENSIC,FORMIDABLE: 
1880 DATA FORTUITOUS,FRACTIOUS,FRUGAL,FRUSTRATE,FURTIVE,FUTILE:
1890 DATA GOSSAMER,GREGARIOUS,HACKNEYED,HAGGARD,HALCYON,HARBINGER: 
1900 DATA HEINOUS,HERESY,HIBERNATE,HILARIOUS,HISTRIONIC,HOAX: 
1910 DATA HOODWINK,HUMID,HYBRID,HYPERBOLE,IDIOSYNCRASY,IGNOMINY: 
1920 END
