2 PRINT "                   WORD" 
3 PRINT "CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY" 
4 PRINT:PRINT:PRINT 
5 DIM S$(5),L$(10),P$(5),Z$(60),A$(5),Q$(5) 
7 REM PORTED TO REPLICA/1 BY CARL CLAUNCH 
10 PRINT "I AM THINKING OF A WORD -- YOU GUESS IT.  I WILL GIVE YOU" 
15 PRINT "CLUES TO HELP YOU GET IT.  GOOD LUCK!!":PRINT:PRINT 
20 REM 
30 PRINT:PRINT:PRINT "YOU ARE STARTING A NEW GAME..." 
40 GOSUB 540 
50 C=RND(11) 
60 S$=Z$(C*5+1,C*5+5) 
70 P$="-----" 
80 A$="-----" 
85 Q=1 
90 G=0 
95 S=LEN(S$) 
150 PRINT "GUESS A FIVE LETTER WORD"; 
160 INPUT L$ 
165 IF LEN(L$)=0 THEN 150 
170 G=G+1 
172 IF S$=L$ THEN 500 
175 L=LEN(L$) 
190 IF L$(1,1)="?" THEN 300 
200 IF L#5 THEN 400 
205 M=0 
210 FOR I=1 TO 5 
215 Y=0 
220 FOR J=1 TO 5 
230 IF S$(I,I)#L$(J,J) THEN 260 
231 GOTO 600 
234 IF I#J THEN 250 
240 Q$=A$(I):A$(I)=L$(J,J):IF I<5 THEN A$(I+1)=Q$(2) 
250 M=M+1 
260 NEXT J 
265 NEXT I 
270 REM 
280 PRINT "THERE WERE ";M;" MATCHES AND THE COMMON LETTERS WERE... "; 
282 FOR I=1 TO 4:PRINT P$(I,I);:PRINT ",";:NEXT I:PRINT P$(5,5) 
285 PRINT "FROM THE EXACT LETTER MATCHES, YOU KNOW............ ";A$ 
286 IF A$=S$ THEN 500 
287 IF M>1 THEN 289 
288 PRINT:PRINT "IF YOU GIVE UP, TYPE '?' FOR YOUR NEXT GUESS." 
289 PRINT 
290 GOTO 150 
300 REM 
310 PRINT "THE SECRET WORD IS *";S$:PRINT 
320 GOTO 30 
400 PRINT "YOU MUST GUESS A FIVE LETTER WORD.  START AGAIN." 
410 PRINT:G=G-1:GOTO 150 
500 PRINT "YOU HAVE GUESSED THE WORD.  IT TOOK ";G;" GUESSES!":PRINT 
510 INPUT "WANT TO PLAY AGAIN?",Q$ 
520 IF Q$="YES" THEN 30 
530 GOTO 999 
540 Z$="DINKYSMOKEWATERGRASSTRAINMIGHTFIRSTCANDYCHAMPWOULDCLUMPDOPEY" 
550 RETURN 
600 IF Q=6 THEN 234 
610 IF Q=1 THEN 650 
620 FOR K=1 TO Q-1 
630 IF L$(J,J)#P$(K,K) THEN 640 
635 Y=1 
640 NEXT K 
650 IF Y=1 THEN 234 
660 Q$=P$(Q):P$(Q)=L$(J,J):IF Q<5 THEN P$(Q+1)=Q$(2) 
670 Q=Q+1 
680 GOTO 234 
999 END 

RUN
