1 OPTIONBASE 1
10 PRINT SPC(32);"HANGMAN"
20 PRINT SPC(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
21 PRINT:PRINT SPC(14);"EDITOR'S NOTE: ALWAYS TYPE IN CAPITAL LETTERS!"
25 PRINT:PRINT
30 PSTR=DIM(12,12):LSTR=DIM(20):DSTR=DIM(20):NSTR=DIM(26):U=DIM(50)
40 C=1: N=50
50 FOR I=1 TO 20: DSTR(I)="-": NEXT: M=0
60 FOR I=1 TO 26: NSTR(I)="": NEXT
70 FOR I=1 TO 12: FOR J=1 TO 12: PSTR(I,J)=" ": NEXT: NEXT
80 FOR I=1 TO 12: PSTR(I,1)="X": NEXT
90 FOR I=1 TO 7: PSTR(1,I)="X": NEXT: PSTR(2,7)="X"
95 IF C<N THEN GOTO 100
97 PRINT "YOU DID ALL THE WORDS!!": END
100 Q=INT(N*RND(1))+1
110 IF U(Q)==1 THEN GOTO 100
115 U(Q)=1: C=C+1: RESTORE: T1=0
150 FOR I=1 TO Q: READ ASTR: NEXT
160 L=LEN(ASTR): FOR I=1 TO LEN(ASTR): LSTR(I)=MID(ASTR,I,1): NEXT
170 PRINT "HERE ARE THE LETTERS YOU USED:"
180 FOR I=1 TO 26: PRINT NSTR(I);: IF NSTR(I+1)=="" THEN GOTO 200
190 PRINT ",";: NEXT
200 PRINT: PRINT: FOR I=1 TO L: PRINT DSTR(I);: NEXT: PRINT: PRINT
210 PRINT "WHAT IS YOUR GUESS";:INPUT GSTR: R=0
220 FOR I=1 TO 26: IF NSTR(I)=="" THEN GOTO 250
230 IF GSTR==NSTR(I) THEN DO(PRINT "YOU GUESSED THAT LETTER BEFORE!"; GOTO 170)
240 NEXT: PRINT "PROGRAM ERROR.  RUN AGAIN.": END
250 NSTR(I)=GSTR: T1=T1+1
260 FOR I=1 TO L: IF LSTR(I)==GSTR THEN GOTO 280
270 NEXT: IF R==0 THEN GOTO 290
275 GOTO 300
280 DSTR(I)=GSTR: R=R+1: GOTO 270
290 M=M+1: GOTO 400
300 FOR I=1 TO L: IF DSTR(I)=="-" THEN GOTO 320
310 NEXT: GOTO 390
320 PRINT: FOR I=1 TO L: PRINT DSTR(I);: NEXT: PRINT: PRINT
330 PRINT "WHAT IS YOUR GUESS FOR THE WORD";:INPUT BSTR
340 IF ASTR==BSTR THEN GOTO 360
350 PRINT "WRONG.  TRY ANOTHER LETTER.": PRINT: GOTO 170
360 PRINT "RIGHT!!  IT TOOK YOU ";T1;" GUESSES!"
370 PRINT "WANT ANOTHER WORD";:INPUT WSTR: IF WSTR=="YES" THEN GOTO 50
380 PRINT: PRINT "IT'S BEEN FUN!  BYE FOR NOW.": GOTO 999
390 PRINT "YOU FOUND THE WORD!": GOTO 370
400 PRINT: PRINT: PRINT"SORRY, THAT LETTER ISN'T IN THE WORD."
410 ON M GOTO 415,420,425,430,435,440,445,450,455,460
415 PRINT "FIRST, WE DRAW A HEAD": GOTO 470
420 PRINT "NOW WE DRAW A BODY.": GOTO 470
425 PRINT "NEXT WE DRAW AN ARM.": GOTO 470
430 PRINT "THIS TIME IT'S THE OTHER ARM.": GOTO 470
435 PRINT "NOW, LET'S DRAW THE RIGHT LEG.": GOTO 470
440 PRINT "THIS TIME WE DRAW THE LEFT LEG.": GOTO 470
445 PRINT "NOW WE PUT UP A HAND.": GOTO 470
450 PRINT "NEXT THE OTHER HAND.": GOTO 470
455 PRINT "NOW WE DRAW ONE FOOT": GOTO 470
460 PRINT "HERE'S THE OTHER FOOT -- YOU'RE HUNG!!"
470 ON M GOTO 480,490,500,510,520,530,540,550,560,570
480 PSTR(3,6)="-": PSTR(3,7)="-": PSTR(3,8)="-": PSTR(4,5)="(": PSTR(4,6)="."
481 PSTR(4,8)=".":PSTR(4,9)=")":PSTR(5,6)="-":PSTR(5,7)="-":PSTR(5,8)="-":GOTO 580
490 FOR I=6 TO 9: PSTR(I,7)="X": NEXT: GOTO 580
500 FOR I=4 TO 7: PSTR(I,I-1)="\": NEXT: GOTO 580
510 PSTR(4,11)="/": PSTR(5,10)="/": PSTR(6,9)="/": PSTR(7,8)="/": GOTO 580
520 PSTR(10,6)="/": PSTR(11,5)="/": GOTO 580
530 PSTR(10,8)="\": PSTR(11,9)="\": GOTO 580
540 PSTR(3,11)="\": GOTO 580
550 PSTR(3,3)="/": GOTO 580
560 PSTR(12,10)="\": PSTR(12,11)="-": GOTO 580
570 PSTR(12,3)="-": PSTR(12,4)="/"
580 FOR I=1 TO 12: FOR J=1 TO 12: PRINT PSTR(I,J);: NEXT
590 PRINT: NEXT: PRINT: PRINT: IF M<>10 THEN GOTO 170
600 PRINT "SORRY, YOU LOSE.  THE WORD WAS ";ASTR
610 PRINT "YOU MISSED THAT ONE.  DO YOU ";: GOTO 370
620 PRINT "TYPE YES OR NO";:INPUT YSTR: IF LEFT(YSTR,1)=="Y" THEN GOTO 50
700 DATA "GUM","SIN","FOR","CRY","LUG","BYE","FLY"
710 DATA "UGLY","EACH","FROM","WORK","TALK","WITH","SELF"
720 DATA "PIZZA","THING","FEIGN","FIEND","ELBOW","FAULT","DIRTY"
730 DATA "BUDGET","SPIRIT","QUAINT","MAIDEN","ESCORT","PICKAX"
740 DATA "EXAMPLE","TENSION","QUININE","KIDNEY","REPLICA","SLEEPER"
750 DATA "TRIANGLE","KANGAROO","MAHOGANY","SERGEANT","SEQUENCE"
760 DATA "MOUSTACHE","DANGEROUS","SCIENTIST","DIFFERENT","QUIESCENT"
770 DATA "MAGISTRATE","ERRONEOUSLY","LOUDSPEAKER","PHYTOTOXIC"
780 DATA "MATRIMONIAL","PARASYMPATHOMIMETIC","THIGMOTROPISM"
990 PRINT "BYE NOW"
999 END
