WORD SEARCH


This is a brainteaser you have probably come across in puzzle magazines, but that doesn't make it any easier.

The words which are hidden in the screen spaghetti are all four letter - related to food or drink.

How to play

When you have found one of the twenty words on the screen, key it in and press RETURN.

If your guess is correct your word will be ticked, if wrong it will be crossed. Your score will be displayed to the right of the word keyed in by yourself. After five seconds the word will be erased and your next word must be entered. The words you have found to date will be blanked out on the screen, which should make it easier for you to spot the others.

To change the screen key in NEXT and press RETURN.

Programming hints

Two methods are used to reduce the memory required in this program. First, all the numerical arrays are integer arrays, this is shown by putting a % sign after the variable names. Secondly the possible words are stored one after another in a string, instead of an array.

Another change that you could make is to alter the words that can be found. There are 57 of them in order to make the puzzles as random as possible. These words are stored in the variable W$ on line 70. If you can think of other four-letters to do with food or drink, then just replace some of the words with those you have chosen. If you want to put in words on a different subject, then think of a subject and replace the words in W$ with your words all joined together. Remember there must be 57 of them, and they must all have four letters.

If you wish to use longer or shorter words, all words must still be of the same length as each other. Change the word in W$ so the total number of letters is still the same. Then change ID in line 240 so 4 is replaced by the number of letters in each word, and 57 is replaced by the maximum number of words in W$. The minimum value of ID must be 1 so 3 should be changed accordingly. The 4 in line 280 should also be changed. If the word length is increased more elements of array L$ must be checked to be empty and then assigned a letter in lines 290 to 310. Also the 80 (which is 20 words of 4 letters) and 4 in line 520 should be changed. The 4 in line 530, and the 3 and 4 in line 570 should also be changed.

Special feature

If you wish to have a collection of word search puzzles to be completed away from the computer, and you have a 40 column printer, then press CNTRL B then RUN the program and the puzzles will be printed out for you. Press CNTRL C after you have finished.

   10 REM Word Search
   20 REM Copyright (C) G.Ludinski 1983
   30 MODE 4
   40 DIM L$(24,18),CH%(20,14),P%(20)
   50 VDU 23,224,0,1,2,4,8,16,160,64
   60 VDU 23,225,255,255,255,255,255,255
,255,255
   70 W$="FISHMEATCAKESOUPPEASSALTCHOPCO
RNWINEBEERLIMEBRANBEANVEALROLLHAKEPIKERO
CKSPAMMALTROLLMINTLAMBPORKBEEFTARTCANENU
TSTUNARICESAKEISAGOLOAFGAMEHERBPEARMILKL
ARDCHIPCTEWOATSPATESAGEMACECRABMASHCOLAP
ITHPEELSOYALEEKDUCKDILLYOLKBALMSUETSODA"
   80 P%(0)=240
   90 REM
  100 REM GENERATE LETTERS
  110 REM
  120 CLS
  130 WC$="":CR=0
  140 FOR I=1 TO 14
  150   FOR J=1 TO 20
  160     L$(J,I)=""
  170     CH%(J,I)=0
  180     NEXT J
  190   NEXT I
  200 FOR I=1 TO 20
  210   D=RND(3)
  220   R=RND(10):IF D=2 THEN R=RND(14)
  230   C=RND(16):IF D=1 THEN C=RND(20)
  240   ID=4*RND(57)-3
  250   FOR Q=0 TO I-1:IF ID=P%(Q) THEN 
240
  260     NEXT Q
  270   P%(I)=ID
  280   WD$=MID$(W$,ID,4)
  290   IF D=1 AND L$(C,R)="" AND L$(C,R
+1)="" AND L$(C,R+2)="" AND L$(C,R+3)=""
 THEN FOR K=0 TO 3:L$(C,R+K)=MID$(WD$,K+
1,1):CH%(C,R+K)=I:NEXTK:GOTO330
  300   IF D=2 AND L$(C,R)="" AND L$(C+1
,R)="" AND L$(C+2,R)="" AND L$(C+3,R)=""
 THEN FOR K=0 TO 3:L$(C+K,R)=MID$(WD$,K+
1,1):CH%(C+K,R)=I:NEXTK:GOTO330
  310   IF D=3 AND L$(C,R)="" AND L$(C+1
,R+1)="" AND L$(C+2,R+2)="" AND L$(C+3,R
+3)="" THEN FOR K=0 TO 3:L$(C+K,R+K)=MID
$(WD$,K+1,1):CH%(C+K,R+K)=I:NEXTK:GOTO33
0
  320   GOTO210
  330   WC$=WC$+WD$
  340   NEXTI
  350 REM
  360 REM DISPLAY LETTERS
  370 REM
  380 FOR I=1 TO 14
  390   FOR J=1 TO 20
  400     IF L$(J,I)="" THEN PRINTTAB(2*
J-2,I*2-1);CHR$(64+RND(26));" ";:GOTO420
  410     PRINTTAB(2*J-2,I*2-1);L$(J,I);
" ";
  420     NEXT J
  430   NEXT I
  440 REM
  450 REM CHECK ANSWER
  460 REM
  470 FOR N=1 TO 20
  480   PRINT TAB(0,29)"What food and dr
ink words can you find                  
                       ";
  490   VDU 11
  500   INPUTI$
  510   IF I$="NEXT" THEN GOTO120
  520   FOR M=1 TO 80 STEP 4
  530     IF I$<>MID$(WC$,M,4) THEN 610
  540     PRINTTAB(8,30)CHR$(224);:CR=CR
+1:PRINTTAB(35,30);CR;
  550     FOR I=1 TO 14
  560       FOR J=1 TO 20
  570         IF CH%(J,I)=(M+3)/4 THEN P
RINTTAB(2*J-2,I*2-1);CHR$(225);
  580         NEXTJ
  590       NEXTI
  600     GOTO630
  610     NEXTM
  620   PRINTTAB(8,30);"  X";:RB$=INKEY$
(500):GOTO480
  630   NEXT N