1 REM http://vintage-basic.net/bcg/word.bas
2 PRINT TAB(33);"WORD"
3 PRINT TAB(15);"CREATIVE COMPUTING  MORRISTOWN, NEW JERSEY"
4 PRINT: PRINT: PRINT
5 @(0)=DUP("dinky") : @(1)=DUP("smoke") : @(2)=DUP("water") : @(3)=DUP("grass")
6 @(4)=DUP("train") : @(5)=DUP("might") : @(6)=DUP("first") : @(7)=DUP("candy")
7 @(8)=DUP("champ") : @(9)=DUP("would") : @(10)=DUP("clump") : @(11)=DUP("dopey")
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 S = @(RND(12))
90 G=0
95 @(12)=LEN(S)
100 FOR I=0 TO LEN(S)-1: @(I+13)=PEEK(S,I): NEXT I
110 FOR I=1 TO 5
120 @(19+I)=ORD("-")
130 NEXT I
140 FOR J=1 TO 5
144 @(40+J)=0
146 NEXT J
150 L=ASK("GUESS A FIVE LETTER WORD ")
170 G=G+1
172 IF COMP(S,L) = 0 THEN 500
173 FOR I=1 TO 7: @(I+40)=0: NEXT I
175 @(26)=LEN(L)
180 FOR I=0 TO LEN(L)-1: @(I+27)=PEEK(L,I): NEXT I
190 IF @(27)=ORD("?") THEN 300
200 IF @(26)#5 THEN 400
205 M=0: Q=1
210 FOR I=1 TO 5
220 FOR J=1 TO 5
230 IF @(I+12) # @(J+26) THEN 260
231 @(Q+40)=@(J+26)
232 Q=Q+1
233 IF I#J THEN 250
240 @(J+19)=@(J+26)
250 M=M+1
260 NEXT J
265 NEXT I
270 @(19)=5
272 @(40)=M
275 A=DUP(""): FOR I=1 TO @(19): A=JOIN(A,CHAR(@(I+19))): NEXT I
277 P=DUP(""): FOR I=1 TO @(40): P=JOIN(P,CHAR(@(I+40))): NEXT I
280 PRINT "THERE WERE ";M;" MATCHES AND THE COMMON LETTERS WERE... ";SHOW(P)
285 PRINT "FROM THE EXACT LETTER MATCHES, YOU KNOW................ ";SHOW(A)
286 IF COMP(A,S)=0 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 S=DUP(""): FOR I=1 TO 7: S=JOIN(S,CHAR(@(I+12))): NEXT I
310 PRINT "THE SECRET WORD IS ";SHOW(S): PRINT
320 GOTO 30
400 PRINT "YOU MUST GUESS A 5 LETTER WORD. START AGAIN."
410 PRINT: G=G-1: GOTO 150
500 PRINT "YOU HAVE GUESSED THE WORD.  IT TOOK ";G;" GUESSES!": PRINT
510 Q = ASK("WANT TO PLAY AGAIN? ")
520 IF COMP(Q, "YES")=0 THEN 30
530 REM 0-11 words, 12-18 S, 19-25 A, 26-32 L, 33-39 D, 40-46 P
999 END
