Scramble
- Type
- Education
- Category
- Two-player word-finding game
- Author
- F. Neil Simms
- Published in
- Antic, January 1985 (Vol. 3, No. 9), bonus game
- Year
- 1985
- Language
- Atari BASIC
- Requirements
- Any Atari 8-bit, Atari BASIC, one or two joysticks (ports 1 and 2)
- Tags
- antic, word-game, spelling, vocabulary, two-player, graphics-1, locate, joystick, education, atari-basic
- Related
- Word Search, Dimension Wizards, Diver, Pegboard, Shoot 'Em Up Math, Sleuth
About the program
Scramble is a computer version of the familiar word-finding puzzle, written by F. Neil Simms as the bonus game in Antic's January 1985 issue. It is designed to build vocabulary and spelling in a way that's fun for all ages. It runs on any Atari of any memory size. One or two players each get a 5×5 grid of letters and race against the same timer to find words by joining neighbouring letters (up, down, sideways or diagonally). Each letter can be used only once per word, and words must be 3 to 10 letters long. Longer words score more points.
The scoring is done by the players themselves. At the end of a round, the program first throws out any word a player entered twice, showing each duplicate above that player's board. Then it presents every remaining word for approval. Push a joystick left to accept a word (a dictionary helps) or right to reject it. The first player to reach the goal score, chosen with SELECT before the game, wins. Otherwise a new round begins.
What you need
Atari BASIC, and a joystick in port 1 (and port 2 for a second player).
Typing it in
Plain ASCII, apart from inverse-video text ({inv}…{/inv}, typed with the Atari key) in about a dozen strings. In GRAPHICS 1, inverse characters appear in a different colour. Antic asked readers to check the listing with TYPO and to SAVE a spare copy.
How to play
Choose the goal with SELECT and press START. Move your cursor with the joystick. The edges wrap round. Press the button on the first letter of a word to mark it, then on each following letter in turn. To finish a word, move the cursor onto any letter you have already marked and press the button again. If you make a mistake, enter the word anyway and reject it at scoring time.
How it works
- Each board is GRAPHICS 1 text. The cursor is shown by redrawing the letter under it in another colour:
LOCATEreads the character, andCOLOR Z+32orCOLOR Z-32changes its colour bits (lines 200–250). Marked letters getCOLOR Z+128(line 480), so line 405 can tell a marked letter from an unmarked one by its code. - Line 420 enforces the "adjacent letters" rule by checking that the new square is within one row and one column of the last.
- Finished words are stored as 10-character slots in one long string,
AR$, with 1000 characters for each player (line 510), so up to 100 words per player per round. - The players share one main loop, so both can play at once. Each player's moves make short beeps on their own sound channel.
Listing
10 REM SCRAMBLE
15 REM BY F. NEIL SIMMS
20 REM ANTIC MAGAZINE
30 GOSUB 5000:GOTO 1000:REM ** init and begin **
38 REM ** time delay loop **
40 IF PEEK(540)<>0 THEN 40
50 RETURN
53 REM ** INPUT: string TP$ **
54 REM ** OUTPUT: LN (nonblank LEN(TP$)) **
55 FOR K=1 TO 10:IF TP$(K,K)=" " THEN LN=K-1:POP :GOTO 65
60 NEXT K:LN=10
65 RETURN
198 REM ** move cursor **
200 TX=X(PLR):TY=Y(PLR):LOCATE TX,TY,Z:COLOR Z-32:POKE 53760+I,I*40+40:POKE 53761+I,168:POKE 77,0
203 IF FIRST(PLR) THEN COLOR Z:FIRST(PLR)=0
204 PLOT TX,TY
205 IF ST=14 OR ST=10 OR ST=6 THEN TY=TY-1:IF TY<3 THEN TY=7
210 IF ST=9 OR ST=5 OR ST=13 THEN TY=TY+1:IF TY>7 THEN TY=3
220 IF ST>8 AND ST<12 THEN TX=TX-1:IF TX<3+XOFF THEN TX=7+XOFF
230 IF ST>4 AND ST<8 THEN TX=TX+1:IF TX>7+XOFF THEN TX=3+XOFF
250 LOCATE TX,TY,Z:COLOR Z+32:PLOT TX,TY:X(PLR)=TX:Y(PLR)=TY
260 RETURN
398 REM ** mark square or end word **
400 FIRE(PLR)=1
405 WD=WORDS(PLR):TX=X(PLR):TY=Y(PLR):LOCATE TX,TY,Z:IF Z>122 THEN 500
410 IF LT=0 THEN 480:REM ** always mark square if first letter **
420 IF ABS(PREVX(PLR)-TX)>1 OR ABS(PREVY(PLR)-TY)>1 THEN 600
480 POKE 53760+I,I*60+60:POKE 53761+I,168:COLOR Z+128:PLOT TX,TY:PREVX(PLR)=TX:PREVY(PLR)=TY
490 T$(TOFF+LT,TOFF+LT)=CHR$(Z-32):IF LT<9 THEN LNG(PLR)=LT+1
495 GOTO 600
499 REM ** square was already marked - process word if valid **
500 IF WD>99 THEN SOUND PLR,255,10,8:GOTO 600:REM ** array full **
505 POKE 53760+I,I*60+60:POKE 53761+I,168:IF LNG(PLR)<3 THEN 515:REM ** word is too short to count **
510 AOFF=PLR*1000+WD*10:AR$(AOFF+1,AOFF+10)=T$(TOFF,TOFF+9):WORDS(PLR)=WD+1
515 T$(TOFF,TOFF+9)=BL$
520 IF NOT PLR THEN FOR Y=3 TO 7:I=(Y-3)*5:POSITION 3,Y:? #6;B$(I+1,I+5):NEXT Y:GOTO 540
530 FOR Y=3 TO 7:I=(Y-3)*5:POSITION 12,10-Y:? #6;B$(I+1,I+5):NEXT Y
540 LNG(PLR)=0:POKE 87,1:POSITION 1+15*PLR,11:? #6;WORDS(PLR);
550 LOCATE TX,TY,Z:COLOR Z+32:PLOT TX,TY
600 RETURN
998 REM ** main play loop **
1000 POKE 53761+PLR*2,0
1002 IF STRIG(0) AND FIRE(0) THEN FIRE(0)=0
1003 IF STRIG(1) AND FIRE(1) THEN FIRE(1)=0
1004 IF PEEK(542)<>0 THEN 1002
1005 POKE 542,5:PLR= NOT PLR:XOFF=9*PLR:TOFF=10*PLR+1:LT=LNG(PLR):WD=WORDS(PLR):I=PLR*2:POKE 87,2
1010 ST=STICK(PLR):IF ST<>15 THEN GOSUB 200:GOTO 1030
1020 T=STRIG(PLR):IF NOT T AND NOT FIRE(PLR) THEN GOSUB 400
1029 REM ** update TIME **
1030 TI=PEEK(540):IF TI THEN 1050
1035 TIME=TIME-1
1040 POKE 540,60:POKE 87,1:POSITION 9,11:? #6;TIME;" ":IF NOT TIME THEN 1200
1050 GOTO 1000:REM ** end of main loop **
1198 REM ** end of round **
1200 GOSUB 2700:FOR I=10 TO 0 STEP -0.3:POKE 53279,0:POKE 540,I:GOSUB 40:NEXT I
1205 POKE 87,2:POSITION 5,0:? #6;"duplicates:":FOR L=0 TO 1
1210 IF WORDS(L)>1 THEN PLR=L:GOSUB 3000
1220 NEXT L
1230 IF WORDS(0)<1 OR WORDS(1)<1 THEN 1240
1235 GOSUB 2800:POSITION 5,0:? #6;" matches: ":GOSUB 3300
1240 GOSUB 2800:POSITION 1,9:? #6;"accept < > reject"
1250 POSITION 5,0:? #6;" {inv}scoring:{/inv} ":FOR L=0 TO 1:PLR=L:GOSUB 3500:NEXT L
1260 POSITION 0,0:FOR I=0 TO 9:? #6;BL$;BL$;:NEXT I:POSITION 1,4:? #6;"{inv}scoring completed{/inv}":POKE 540,200:GOSUB 40
1270 IF SCORE(0)<WIN AND SCORE(1)<WIN THEN 1300:REM ** skip following if not end of game **
1280 IF SCORE(0)>SCORE(1) THEN WINNER=0:GOTO 1295
1285 IF SCORE(0)=SCORE(1) THEN 1297
1290 WINNER=1
1295 POSITION 2,6:? #6;"player #";WINNER+1;" wins!":GOTO 1298
1297 POSITION 5,6:? #6;"it's a tie!"
1298 FOR I=50 TO 250 STEP 3:POKE 540,0:GOSUB 40:SOUND 0,I,10,6:SOUND 1,300-I,10,6:NEXT I:GOSUB 2700:GOTO 1500
1300 GOSUB 4000:GOSUB 2000:GOSUB 2500:ROUND=ROUND+1:POKE 87,1:POSITION 13-1*(ROUND>9),13:? #6;ROUND;:GOSUB 2600
1340 GOTO 1000:REM ** start next round **
1500 GOSUB 2600:GOSUB 5080:GOTO 1000:REM ** end of game - restart **
1998 REM ** display letter grid **
2000 POKE 87,2:? #6;CHR$(125):POSITION 6,0:? #6;;"{inv}s{/inv}cR{inv}Am{/inv}bL{inv}E{/inv}"
2005 FOR I=1 TO 25:C=INT(PEEK(RANDOM)*96/256)+1:B$(I,I)=L$(C,C):NEXT I
2010 FOR Y=3 TO 7:I=(Y-3)*5:POSITION 3,Y:? #6;B$(I+1,I+5):POSITION 12,10-Y:? #6;B$(I+1,I+5):NEXT Y
2039 REM ** border **
2040 FOR Y=2 TO 8 STEP 6:FOR X=2 TO 8:POSITION X,Y:? #6;"{inv}+{/inv}":POSITION X+9,Y:? #6;"{inv}+{/inv}":NEXT X:NEXT Y
2050 FOR X=2 TO 8 STEP 6:FOR Y=3 TO 7:POSITION X,Y:? #6;"{inv}+{/inv}":POSITION X+9,Y:? #6;"{inv}+{/inv}":NEXT Y:NEXT X
2060 FOR I=0 TO 1:PLR=I:XOFF=9*PLR:GOSUB 200:NEXT I
2100 RETURN
2498 REM ** build scoring window **
2500 POKE 87,1:FOR I=0 TO 15 STEP 15:POSITION I,10:? #6;"{inv}WORDS{/inv}";
2510 POSITION I+1,11:? #6;"0 ";:POSITION I,12:? #6;"{inv}score{/inv}";:POSITION I+1,13:? #6;SCORE(I-14*(I=15)):NEXT I
2515 SOUND 0,120,10,8:POKE 540,10:GOSUB 40:GOSUB 2700
2520 POSITION 8,10:? #6;"{inv}time{/inv}":POSITION 9,11:? #6;"200":POSITION 6,13:? #6;"round: ";
2550 RETURN
2598 REM ** "go on" prompt **
2600 POKE 87,2:POSITION 0,9:? #6;"press {inv}fire{/inv} to go on":IF PEEK(53279)=6 THEN POP :GOSUB 5080:GOTO 1000
2610 IF STRIG(0) AND STRIG(1) THEN POSITION 6,9:? #6;"FIRE":GOTO 2600
2620 IF NOT STRIG(0) OR NOT STRIG(1) THEN 2620
2630 POSITION 0,1:? #6;BL$;BL$:POSITION 0,9:? #6;BL$;BL$:RETURN
2698 REM ** turn off sound **
2700 POKE 53761,0:POKE 53763,0:RETURN
2798 REM ** 4 clicks **
2800 FOR I=1 TO 4:POKE 540,5:POKE 53279,0:GOSUB 40:NEXT I:RETURN
2998 REM ** find and delete dups **
3000 FOR I=1+1000*PLR TO WORDS(PLR)*10-19+1000*PLR STEP 10:TP$=AR$(I,I+9):DUP=0:POKE 53279,0
3020 IF TP$=BL$ THEN 3060
3025 FOR J=I+10 TO WORDS(PLR)*10-19+1000*PLR STEP 10
3030 IF TP$<>AR$(J,J+9) THEN 3055
3035 IF PEEK(540)<>0 AND NOT DUP THEN 3035
3037 IF NOT STRIG(0) OR NOT STRIG(1) THEN 3037
3040 AR$(J,J+9)=BL$:IF NOT DUP THEN POSITION 0+10*PLR,1:? #6;TP$:POKE 540,120:DUP=1
3055 NEXT J
3060 NEXT I
3070 POKE 540,120:GOSUB 40:POSITION 0+10*PLR,1:? #6;BL$:RETURN
3298 REM ** find matches and eliminate **
3300 FOR I=1 TO WORDS(0)*10-9 STEP 10:TP$=AR$(I,I+9):POKE 53279,0:IF TP$=BL$ THEN 3380
3325 FOR J=1001 TO WORDS(1)*10-9+1000 STEP 10
3330 IF TP$<>AR$(J,J+9) THEN 3375
3340 GOSUB 40:IF NOT STRIG(0) OR NOT STRIG(1) THEN 3340
3350 AR$(J,J+9)=BL$:AR$(I,I+9)=BL$:POSITION 8,1:? #6;TP$:POKE 540,180:POP :GOTO 3380
3375 NEXT J
3380 NEXT I
3390 GOSUB 40:POSITION 5,1:? #6;BL$:RETURN
3498 REM ** let players review words **
3500 NONE=1:FOR I=1+1000*PLR TO WORDS(PLR)*10-9+1000*PLR STEP 10:TP$=AR$(I,I+9):IF TP$=BL$ THEN 3600
3530 POSITION 0+10*PLR,1:? #6;BL$:FOR N=1 TO 10:POSITION 10+10*PLR-N,1:? #6;TP$(1,N):NEXT N:NONE=0
3540 S1=STICK(0):S2=STICK(1):POKE 540,20
3550 IF S1<>7 AND S2<>7 THEN 3560
3555 POSITION 12,9:? #6;"{inv}reject{/inv}":SOUND 0,200,12,6:GOSUB 40:POSITION 12,9:? #6;"reject":GOTO 3590
3560 IF S1<>11 AND S2<>11 THEN 3540
3565 POSITION 1,9:? #6;"{inv}accept{/inv}":SOUND 0,100,8,6:GOSUB 55:ADD=1*(LN<5)+(LN-3)*(LN>=5)
3570 SCORE(PLR)=SCORE(PLR)+ADD:POKE 87,1:POSITION 1+15*PLR,13:? #6;SCORE(PLR);:POKE 87,2
3580 GOSUB 40:POSITION 1,9:? #6;"accept"
3590 IF NOT STRIG(0) OR NOT STRIG(1) THEN 3590
3600 GOSUB 2700:GOSUB 40:NEXT I
3605 IF NONE THEN POSITION 1+10*PLR,1:? #6;"no words":POKE 540,200:GOSUB 40
3610 POSITION 0+10*PLR,1:? #6;BL$:RETURN
3998 REM ** initialize var's **
4000 AR$=" ":AR$(2000)=AR$:AR$(2)=AR$:T$=AR$:FOR I=0 TO 1:LNG(I)=0:WORDS(I)=0:FIRST(I)=1:NEXT I
4010 X(0)=3:X(1)=12:Y(0)=3:Y(1)=3:TIME=200
4050 RETURN
4998 REM ** initialize **
5000 GRAPHICS 2:DL=PEEK(560)+256*PEEK(561):WIN=50:RANDOM=53770:SETCOLOR 4,6,2:GOAL=50
5030 FOR I=15 TO 18:POKE DL+I,6:NEXT I
5040 POKE DL+19,65:POKE DL+20,PEEK(560):POKE DL+21,PEEK(561)
5060 DIM AR$(2000),T$(20),LNG(1),WORDS(1),X(1),Y(1),PREVX(1),PREVY(1),B$(25),L$(96),BL$(10),TP$(10),SCORE(1)
5070 DIM FIRST(1),FIRE(1)
5075 L$="AAAAAAAABBBCCCDDDDEEEEEEEEEEFFGGGHHHIIIIIIIJKKLLLLLMMMNNNNNOOOOOOPPPQRRRRSSSSSTTTTTUUUUVVWWXYYYZ"
5080 GOSUB 4000:BL$=T$:SCORE(0)=0:SCORE(1)=0
5100 GOSUB 2000:GOSUB 2500:ROUND=1:POKE 87,1:POSITION 13,13:? #6;ROUND;:POSITION 1,13:? #6;"0 ";:POSITION 16,13
5110 ? #6;"0 ";:POKE 87,2
5120 POKE 540,15:POSITION 2,9:? #6;"select GOAL: ";GOAL;" ";
5130 POSITION 0,1:? #6;"press {inv}start{/inv} to begin";:GOSUB 40
5140 N=PEEK(53279):IF N=6 THEN 5170
5150 IF N=5 THEN GOAL=GOAL+50:IF GOAL>200 THEN GOAL=50:POSITION 15,9:? #6;GOAL;" ";
5160 POSITION 2,9:? #6;"{inv}select{/inv}":POSITION 6,1:? #6;"start":POKE 540,15:GOSUB 40:GOTO 5120
5170 POSITION 0,1:? #6;BL$;BL$:POSITION 0,9:? #6;BL$;BL$:WIN=GOAL
5200 RETURN
Download
The original program from the Antic disk, to LOAD or ENTER instead of typing it: SCRAMBLE.BAS.
Credits
- Program listing: Scramble — program listing (Antic, January 1985 (Vol. 3, No. 9), bonus game) — F. Neil Simms
- Picture: The two boards before a round. The second board has the same letters with the rows in reverse order. — F. Neil Simms (program); screenshot by the site
- Antic Software Archive — disk files (January 1985 - Vol. 3 No. 9): SCRAMBLE.BAS — F. Neil Simms, 1985
- Antic magazine scan (OCR text layer): Antic_Vol_3-09_1985-01_Utility_Programs_text.pdf — Brian McWilliams; Internet Archive
