KARTIK is a computerised referee and scorekeeper for a two-to-eight-player crossword board game. The program manages a 6×6 board stored in a two-dimensional array, a 60-card letter deck with fractional encoding to carry both letter identity and point value in a single floating-point number, and per-player hand tracking. Word scoring validates up to four directions (across, diagonal-up, diagonal-down, and straight down) by mapping each entered word back onto the board coordinates relative to the card just played. A special “Star” wildcard card is tracked separately, requiring the player to nominate a letter each turn, with its board representation updated accordingly.
Program Structure
The code is organised as a main loop with numbered subroutine blocks:
- Lines 10–99: Constants, array declarations
- Lines 100–465: Main game loop — setup, play, end-of-game detection, rematch
- Lines 1000–1099: Title/splash screen
- Lines 1100–1199: Rules display (paged)
- Lines 1300–1499: Options, name entry, card dealing
- Lines 1500–1599: Card placement input handler
- Lines 1600–1699: Full board redraw
- Lines 1700–1865: Star-card letter assignment and validation
- Lines 1900–1949: Single-cell display routine
- Lines 2000–2099: Board frame draw
- Lines 2100–2299: Per-turn display and card reveal
- Lines 2300–2499: Word entry and challenge loop
- Lines 2500–2738: Word scoring and board-match validation
- Lines 2800–2899: Winner determination
- Lines 2900–2958: Display helpers
- Lines 3000–3099: End-of-game score table
- Lines 5000–5010: SAVE and restart
Symbolic Constant Initialisation
Because the ZX81/TS1000 has no named constants, lines 30–56 build all frequently used integer values arithmetically from O=0 and V=NOT O (i.e. 1). This avoids embedding raw literals that would each cost extra memory and makes the intent self-documenting to an extent:
| Variable | Value | Derivation |
|---|---|---|
O | 0 | explicit |
V | 1 | NOT 0 |
T | 2 | V+V |
U | 3 | T+V |
F | 4 | T+T |
G | 6 | U+U |
N | 9 | G+U |
E | 15 | G+N |
A | 14 | E-V |
R | 16 | E+V |
Z | 20 | R+F |
M | 60 | U*Z |
Q | 64 | M+F |
H | 128 | Q+Q |
M=60 is the deck size; Q=64 and H=128 are ASCII/character-code thresholds used to distinguish card colours (red vs. black) via the fractional encoding scheme.
Card Encoding Scheme
Each of the 60 cards is stored as a single floating-point number in the D() array. The integer part encodes the letter (as its character code, optionally offset by 128 for red cards), and the fractional part encodes the point score. Specifically, line 1434 sets D(J)=S+VAL P$(K)/R where S is the character code and R=16, so scores 1–4 map to fractions 0.0625, 0.125, 0.1875, 0.25. The score is later recovered at line 2170: LET S=R*(D(K)-INT D(K)). Red cards have character codes above Q (64); the star card is detected specially.
The same encoding is used in the board array B(), allowing a single cell to carry colour, letter, and score simultaneously.
Board Display
Subroutine 1900 displays a single cell using PRINT AT with the formula AT U*X-T, U*Y+N+T (where U=3), giving each cell a 3-column-wide slot. Red cards print an inverse-video prefix character (character code T*F*C = 2*4*C = 8*C, selecting the inverse space when C=1). The board frame is drawn once at line 2000 using embedded block-graphics characters and row/column labels.
Word Scoring and Validation (lines 2500–2738)
The scoring subroutine checks whether a player-typed word matches the board in one of four directions (encoded in W: 1=across, 2=diag-up, 3=diag-down, 4=down). It first scans the word string for the character matching the current card (B(X,Y)), establishing the card’s position K within the word. It then walks backward from K and forward to L verifying each character against B() at the appropriate board coordinates. The direction offset logic uses the idiom (W=T)-(W=U) (i.e. +1 for diagonal-up, -1 for diagonal-down) to compute the row delta per column step.
Hand and Deck Management
The two-dimensional array S(player, column) tracks per-player state:
S(I,1): cards remaining in handS(I,2): score for current gameS(I,3): (unused directly in display; reserved)S(I,4): card currently placed (substitution candidate)
Cards in each player’s hand occupy a contiguous segment of D(): player I‘s top card is at index PX*I - S(I,1) + 1 (line 2155). When a substitution is made, the displaced card is appended to the bottom of the hand or discarded depending on colour (lines 325–340).
Star Card Handling
The star card (C$="*") requires the player to nominate a letter each time it is played or lands in a new word. Subroutine 1700 handles both the initial placement case and subsequent turns where the star is already on the board (lines 1785–1799). A second flag SF tracks whether the star is currently on the board. The star’s board value is stored as CODE X$ + V/R, a non-integer that distinguishes it from ordinary cards while its display character (uppercase letter + 128 for red) is shown in inverse video.
Dealing Algorithm
Lines 1415–1435 implement a rejection-sampling shuffle: for each of the 60 positions in the deck string D$, a random index J is chosen uniformly and retried until an empty slot is found. This is a classic occupancy shuffle, O(n log n) average, appropriate for small n=60.
Notable Idioms and Techniques
SLOW/FASTused deliberately: slow mode for text I/O, fast mode for computation-heavy sections like dealing and board drawing.FOR I=V TO LEN X$loops scanning strings, withLET I=LEN X$as a break idiom.PRINT AT Z+V,O;" ... "followed byPRINT AT Z+V,O;is used to clear a status line before redisplaying, rather thanCLS.- The block-graphic characters in the title screen (line 1010–1030) spell out “KARTIK” in large pixel-font style using Spectrum block graphics.
- Line 1330 computes
PX(cards per player) with special-case corrections for 5 and 7 players:PX=(Q-R+T*(P=F+V)+(P=G+V))/P= (48 + 2*(P=5) + 1*(P=7))/P, giving 10/9/8/7/10/7/7 for 2–8 players respectively, matching the rules text.
Content
Source Code
10 REM ***** KARTIK (TM) *****
12 REM *** A WORD GAME FOR ***
14 REM *** 2 TO 8 PLAYERS ****
16 REM ** PROGRAM COPYRIGHT **
18 REM ***** (C) 1984 BY *****
20 REM * WILLCOCKS RESEARCH **
22 REM ***** CONSULTANTS *****
25 REM *VERSION 1.02 12/05/84*
30 LET O=0
32 LET V=NOT O
34 LET T=V+V
36 LET U=T+V
38 LET F=T+T
40 LET G=U+U
42 LET N=G+U
44 LET E=G+N
46 LET A=E-V
48 LET R=E+V
50 LET Z=R+F
52 LET M=U*Z
54 LET Q=M+F
56 LET H=Q+Q
60 DIM Y$(V)
65 DIM B(G,G)
70 DIM D(M)
75 DIM S(G+T,F)
85 DIM W$(F,F+G)
90 DIM W(F)
95 DIM N$(G+T,N+V)
100 RAND
110 LET CP=V
120 LET EF=O
130 LET D$="AAA%ABB%BCC%CDDEEE%EFFGGHHII%IJKKLL%LMMNN%NOO%OPPQRR%RSS%STTU%UVWWXYYZ%*"
140 LET P$="122213231433231252121434351"
150 GOSUB 1000
160 IF Y$<>"Y" THEN GOTO 180
170 GOSUB 1100
180 GOSUB 1300
190 GOSUB 2000
195 GOSUB 1600
200 GOSUB 2100
210 GOSUB 1500
220 IF C$="*" OR SF THEN GOSUB 1700
230 GOSUB 2300
240 IF EF THEN GOTO 210
250 LET S(CP,T)=S(CP,T)+S
300 IF NOT S(CP,F) THEN LET B=B+V
305 IF NOT S(CP,V) THEN LET D=D-V
310 IF S(CP,F) THEN LET DC=DC+V-C
315 IF S(CP,V) THEN LET S(CP,V)=S(CP,V)-V+C*(S(CP,F)>O)
320 IF NOT C OR NOT S(CP,F) THEN GOTO 400
322 IF S(CP,V)=V THEN GOTO 340
325 FOR I=PX*CP+T-S(CP,V) TO PX*CP
330 LET D(I-V)=D(I)
335 NEXT I
340 LET D(PX*CP)=S(CP,F)
400 LET CP=CP+V
405 IF CP>P THEN LET CP=V
410 LET S=S(CP,V)
415 IF B+DC<M AND B<Z+R AND (S OR D) THEN GOTO 200
420 LET K=T
425 GOSUB 2800
430 GOSUB 3000
435 PRINT AT R,O;"ANOTHER GAME - Y/N? ";
440 INPUT Y$
445 PRINT AT R,Z;Y$
450 IF Y$="N" THEN GOTO 500
455 IF Y$<>"Y" THEN GOTO 440
460 GOSUB 1380
465 GOTO 190
500 LET K=U
510 GOSUB 2800
520 PRINT AT O,O;"FINAL SCORES: "
530 PRINT AT A,O;"MATCH WAS ";
540 GOSUB 3035
999 STOP
\n1000 PRINT AT V,O;"********************************"
\n1010 PRINT AT U,U;"N \: \ .\' \.'\''\. \:'\''\. \''\:'\' \ : \: \ .\' TM P"
\n1020 PRINT TAB T;"U \:.\: \:.\..\: \:'\': \: \ : \:.\: E"
\n1030 PRINT TAB V;"F \: \ '\. \: \: \: \: \: \ : \: \ '\. P"
\n1035 PRINT AT G+V,G;"OR CROSSWORD TANGO"
\n1040 PRINT AT N,O;"A WORD GAME FOR 2 TO 8 PLAYERS"
\n1050 PRINT AT N+T,O;"U. K. PATENT NO. 449,879 (1936) COPYRIGHT (C) 1935 BY","E. W. WILLCOCKS.","PROGRAM COPYRIGHT (C) 1984 BY WILLCOCKS RESEARCH CONSULTANTS."
\n1055 PRINT AT A+U,O;"KARTIK IS A TRADE MARK OF","WILLCOCKS RESEARCH CONSULTANTS."
\n1060 PRINT AT Z,O;"********************************"
\n1070 PRINT "DO YOU WANT INSTRUCTIONS-Y/N?";
\n1075 SLOW
\n1080 INPUT Y$
\n1085 IF Y$<>"Y" AND Y$<>"N" THEN GOTO 1080
\n1090 PRINT Y$
\n1099 RETURN
\n1100 CLS
\n1101 FAST
\n1102 PRINT TAB N-V;"RULES OF KARTIK"
\n1105 PRINT AT T,T;"KARTIK IS A CROSSWORD GAME FOR2 TO 8 PLAYERS. IT IS PLAYED ONA 6X6 SQUARE BOARD WITH A DECK OF 60 LETTER CARDS."
\n1110 PRINT AT G+V,T;"48 CARDS (49 FOR 7 PLAYERS OR 50 FOR 5) ARE DEALT FACE DOWN TOTHE PLAYERS. THE REMAINING CARDSARE THE DECK, LEFT FACE DOWN."
\n1115 PRINT AT N+U,T;"ON HIS TURN, EACH PLAYER TAKESTHE TOP CARD FROM HIS HAND,","LOOKS AT IT AND PLACES IT ON THEBOARD, TRYING TO MAKE WORDS OF 2 TO 6 LETTERS. WORDS MAY READ ACROSS, DIAGONALLY UP OR DIAGON-ALLY DOWN, FROM LEFT TO RIGHT, OR STRAIGHT DOWN."
\n1120 GOSUB 1185
\n1130 CLS
\n1135 PRINT AT V,T;"EACH LETTER HAS A POINT SCORE.THESE ARE TOTALLED FOR EACH NEW WORD FORMED, NO MORE THAN ONE INEACH ALLOWED DIRECTION, AND ALL MUST INCLUDE THE CARD PLAYED."
\n1140 PRINT AT G+V,T;"AFTER SIX CARDS ARE PLAYED, ASLONG AS AT LEAST 6 EMPTY SQUARESARE LEFT, THE PLAYER MAY SUBSTI-TUTE HIS CARD FOR ANY BLACK","LETTER ON THE BOARD. IF HIS CARDIS RED, HE ADDS THE OLD CARD TO THE BOTTOM OF HIS HAND; IF IT ISBLACK, IT IS DISCARDED. HE MAY NOT SUBSTITUTE FOR A RED CARD."
\n1145 PRINT AT Z-U,T;"THE RED STAR CARD MAY BE","CHANGED TO REPRESENT ANY LETTER AT EACH TURN, WHEN A NEW WORD WHICH USES IT IS COMPLETED."
\n1150 GOSUB 1185
\n1160 CLS
\n1165 PRINT AT V,O;"THE STAR ALWAYS SCORES 1 POINT. NEW WORDS FORMED BY CHANGING","THE LETTER IT REPRESENTS ARE NOTCOUNTED UNLESS THEY CONTAIN THE CARD JUST PLAYED."
\n1170 PRINT AT G+V,T;"WHEN A PLAYER HAS NO CARDS","LEFT, HE USES THE TOP CARD FROM THE DECK. HE MAY NOT SUBSTITUTE."
\n1175 PRINT AT A-U,T;"THE GAME ENDS WHEN THE BOARD IS FILLED, ALL CARDS HAVE BEEN USED, OR A PLAYER HAS NO CARDS AND THE DECK IS USED UP. THE PLAYER WITH THE HIGHEST TOTAL ISTHE WINNER."
\n1180 PRINT AT Z-T,T;"THE WINNER DEALS FOR THE NEXT GAME, THE PLAYER TO HIS LEFT IS THE FIRST TO PLAY."
\n1185 PRINT AT V+Z,G;"PRESS ""ENTER"" TO CONTINUE"
\n1190 INPUT Y$
\n1199 RETURN
\n1300 CLS
\n1305 FAST
\n1310 PRINT TAB G;"KARTIK OPTIONS",,,"HOW MANY PLAYERS? ";
\n1315 INPUT P
\n1320 IF P<T OR P>G+T THEN GOTO 1315
\n1325 PRINT P
\n1330 LET PX=(Q-R+T*(P=F+V)+(P=G+V))/P
\n1335 LET D=M-P*PX
\n1340 PRINT AT F,O;"EACH PLAYER WILL BE DEALT ";PX,"LETTER CARDS, FACE DOWN. THE REMAINING ";D;" CARDS WILL BE THE DECK. PLAYERS DRAW FROM THE","DECK WHEN THEY HAVE NO MORE","CARDS IN THEIR HANDS."
\n1350 PRINT AT A-U,O;"ENTER NAMES OF THE PLAYERS:"
\n1360 FOR I=V TO P
\n1365 INPUT N$(I)
\n1370 PRINT I;TAB U;N$(I)
\n1375 NEXT I
\n1380 PRINT AT Z,O;"DEALING THE CARDS ... ";
\n1390 SLOW
\n1400 FOR I=V TO M
\n1405 LET D(I)=O
\n1410 NEXT I
\n1412 FAST
\n1415 FOR I=V TO M
\n1420 LET J=V+INT (M*RND)
\n1425 IF D(J) THEN GOTO 1420
\n1430 LET S=CODE D$(I)
\n1432 LET K=S-H*(S>Q)+(Z+E+G)*(S=H+Z+U)-Z-E-T
\n1434 LET D(J)=S+VAL P$(K)/R
\n1435 NEXT I
\n1440 SLOW
\n1445 PRINT "DONE."
\n1450 FOR I=V TO G
\n1455 FOR J=V TO G
\n1460 LET B(I,J)=O
\n1465 NEXT J
\n1470 NEXT I
\n1475 LET B=O
\n1480 FOR I=V TO P
\n1485 LET S(I,V)=PX
\n1488 LET S(I,T)=O
\n1490 NEXT I
\n1492 LET D=M-P*PX
\n1495 LET DC=O
\n1497 LET SF=O
\n1499 RETURN
\n1500 INPUT X$
\n1501 LET EF=O
\n1505 LET Y=O
\n1510 LET X=CODE X$-Z-E-T
\n1515 FOR I=V TO LEN X$
\n1520 IF X$(I)>"0" AND X$(I)<"7" THEN LET Y=VAL X$(I)
\n1525 NEXT I
\n1530 PRINT X$(1);",";Y
\n1532 SLOW
\n1535 IF X<V OR X>G THEN GOTO 2212
\n1540 IF Y<V OR Y>G THEN GOTO 2218
\n1545 IF NOT B(X,Y) THEN GOTO 1560
\n1550 IF B<G OR B>=A+R THEN GOTO 2230
\n1555 IF NOT S(CP,V) OR B(X,Y)>Q OR INT B(X,Y)=CODE C$ THEN GOTO 2238
\n1560 LET S(CP,F)=B(X,Y)
\n1565 LET B(X,Y)=D(K)
\n1570 GOSUB 1900
\n1599 RETURN
\n1600 FOR X=V TO G
\n1610 FOR Y=V TO G
\n1620 GOSUB 1900
\n1630 NEXT Y
\n1640 NEXT X
\n1699 RETURN
\n1700 IF SF THEN GOTO 1785
\n1705 LET X1=X
\n1710 LET Y1=Y
\n1720 PRINT AT E,O;"YOU MUST ";TAB O;"CHOOSE A ";TAB O;"LETTER FOR ";TAB O;"THE STAR. "
\n1728 GOTO 1740
\n1730 PRINT AT E,O;"PUSH ""ENTER""";TAB O;"IF NO CHANGE";TAB O;"OR ELSE TYPE";TAB O;"NEW LETTER. "
\n1740 PRINT "WHAT LETTER ";TAB O;"WILL THE STAR CARD";TAB O;"NOW REPRESENT? "
\n1745 INPUT Y$
\n1750 IF (Y$="" OR Y$=CHR$ (H-N-V) OR Y$=" ") AND SF THEN RETURN
\n1752 IF Y$<"A" OR Y$>"Z" THEN GOTO 1745
\n1754 IF SF OR INT S(CP,F)<>CODE Y$ THEN GOTO 1758
\n1755 PRINT AT E+T,O;"DIFFERENT ";TAB O;"LETTER. "
\n1757 GOTO 1740
\n1758 LET SF=V
\n1760 PRINT AT Z+V,E;Y$
\n1765 LET X$=CHR$ (CODE Y$+H)
\n1770 PRINT AT U*X1-V,U*Y1+A-U;X$
\n1775 LET B(X1,Y1)=CODE X$+V/R
\n1780 RETURN
\n1785 IF X<>X1 AND Y<>Y1 AND X+Y<>X1+Y1 AND X-Y<>X1-Y1 THEN RETURN
\n1786 LET EF=V
\n1787 GOSUB 1800+50*(Y=Y1)
\n1790 IF NOT EF THEN RETURN
\n1795 LET EF=O
\n1798 LET Y$=""
\n1799 GOTO 1730
\n1800 FOR I=Y TO Y1 STEP SGN (Y1-Y)
\n1805 LET J=X+(I-Y)*SGN (Y1-Y)*SGN (X1-X)
\n1810 IF B(J,I)=O THEN LET EF=O
\n1815 NEXT I
\n1820 RETURN
\n1850 FOR I=X TO X1 STEP SGN (X1-X)
\n1855 IF B(I,Y)=O THEN LET EF=O
\n1860 NEXT I
\n1865 RETURN
\n1900 LET Y$=CHR$ (T*F*(B(X,Y)>Q))
\n1905 LET X$=CHR$ (INT B(X,Y)-H*(Y$>" "))
\n1910 IF NOT SF THEN GOTO 1930
\n1920 IF X=X1 AND Y=Y1 THEN LET X$=CHR$ (CODE X$+H)
\n1930 PRINT AT U*X-T,U*Y+N+T;Y$;CHR$ (T*A*(B(X,Y)>O)+R*(B(X,Y)-INT B(X,Y)));TAB U*Y+N+T;X$;Y$
\n1940 PRINT AT Z-V,O;
\n1949 RETURN
\n2000 CLS
\n2005 FAST
\n2010 PRINT TAB N+U;"% % % % % % % % % % % % % % % % % % % % "
\n2015 FOR I=O TO G-V
\n2020 PRINT TAB N+U;"% \: \: \: \: \: \: % "
\n2025 PRINT TAB N+U;"%A%B%C%D%E%F"(I+1);"\: \: \: \: \: \: % "
\n2030 PRINT TAB N+U;"% \:.\..\..\:.\..\..\:.\..\..\:.\..\..\:.\..\..\:.\..\..% "
\n2035 NEXT I
\n2040 PRINT TAB N+U;"% % %1% % %2% % %3% % %4% % %5% % %6% % "
\n2050 PRINT TAB Z-V;"%K%A%R%T%I%K"
\n2055 PRINT AT O,O;"P LEFT SCORE"
\n2060 PRINT AT N,O;"PLAYER YOUR";TAB O;"TO GO: CARD";TAB O;" \..\..\..\. ";TAB O;"DECK: \: \##\##\: ";TAB O;"DISCARD \: \##\##\: ";TAB O;"PILE: \:.\..\..\: "
\n2099 RETURN
\n2100 FAST
\n2105 PRINT AT V,O;
\n2110 FOR I=V TO P
\n2115 PRINT N$(I,V TO U);TAB F-(S(I,V)>N);" ";S(I,V);TAB N+T-LEN STR$ S(I,T);S(I,T)
\n2120 NEXT I
\n2125 PRINT AT N+T,O;N$(CP,V TO G+T)
\n2130 PRINT AT N+U,G-V;
\n2135 IF D<=N THEN PRINT " ";
\n2140 PRINT D
\n2145 PRINT AT A,G+V-LEN STR$ DC;DC
\n2150 IF NOT S(CP,V) THEN GOTO 2200
\n2155 LET K=PX*CP-S(CP,V)+V
\n2160 LET C=(D(K)>Q)
\n2165 LET C$=CHR$ (D(K)-H*C)
\n2170 LET S=R*(D(K)-INT D(K))
\n2175 PRINT AT A-T,N;CHR$ (T*F*C);S;TAB N;C$;CHR$ (T*F*C)
\n2180 IF NOT S(CP,V) THEN GOTO 2190
\n2185 GOSUB 2910
\n2190 PRINT AT Z-V,O;"WHERE DO YOU";TAB O;"WANT TO PUT YOUR ";TAB O;"CARD - ROW, COLUMN? "
\n2195 PRINT AT Z+V,Z;
\n2199 RETURN
\n2200 PRINT AT E,O;"YOUR HAND IS";TAB O;"EMPTY. YOU ";TAB O;"DREW A CARD ";TAB O;"FROM DECK. "
\n2205 LET K=M+V-D
\n2210 GOTO 2160
\n2212 PRINT AT E,O;"ROW MUST BE ";TAB O;"A TO F. "
\n2216 GOTO 2222
\n2218 PRINT AT E,O;"COLUMN MUST ";TAB O;"BE 1 TO 6. "
\n2222 PRINT " "
\n2224 PRINT "TRY AGAIN "
\n2226 GOSUB 2195
\n2228 GOTO 1500
\n2230 PRINT AT E,O;"YOU MUST PUT";TAB O;"IT ON AN ";TAB O;"EMPTY SQUARE"
\n2236 GOTO 2224
\n2238 PRINT AT E,O;"YOU CANNOT ";TAB O;"SUBSTITUTE "
\n2242 IF S(CP,V) THEN GOTO 2248
\n2244 PRINT "FROM DECK. "
\n2246 GOTO 2224
\n2248 IF B(X,Y)<Q THEN GOTO 2254
\n2250 PRINT "A RED CARD. "
\n2252 GOTO 2224
\n2254 IF INT B(X,Y)<>CODE C$ THEN GOTO 1560
\n2256 PRINT "SAME LETTER."
\n2258 GOTO 2224
\n2260 PRINT AT E,O;"YOU HAVE TO ";TAB O;"SCORE IF YOU";TAB O;"SUBSTITUTE. ";TAB O;"TRY AGAIN. "
\n2268 LET EF=V
\n2270 GOTO 2310
\n2272 PRINT AT E,O;"YOUR MOVE IS";TAB O;"TAKEN BACK. ";TAB O;"YOU HAVE TO ";TAB O;"DO IT AGAIN."
\n2274 IF NOT SF THEN GOTO 2280
\n2276 IF X=X1 AND Y=Y1 THEN LET SF=O
\n2280 LET B(X,Y)=S(CP,F)
\n2282 GOSUB 1900
\n2283 GOSUB 2190
\n2284 RETURN
\n2300 LET S=O
\n2305 GOSUB 2910
\n2310 PRINT "DO YOU HAVE ";TAB O;"ANY WORDS TO SCORE "
\n2313 GOSUB 2920
\n2314 PRINT "- Y/N? ";
\n2316 INPUT Y$
\n2317 PRINT AT Z+V,G+V;Y$
\n2318 IF Y$="Y" THEN GOTO 2330
\n2320 IF Y$<>"N" THEN GOTO 2316
\n2322 IF NOT S(CP,F) THEN RETURN
\n2324 IF EF THEN GOTO 2272
\n2326 GOTO 2260
\n2330 GOSUB 2950
\n2331 GOSUB 2900
\n2332 PRINT "ENTER WORDS ";TAB O;"IN ORDER ABOVE OR ";TAB O;"PRESS ""ENTER"" TO SKIP DIRECTION."
\n2340 FOR I=V TO F
\n2341 INPUT X$
\n2342 LET W$(I)=X$
\n2343 LET W(I)=LEN X$
\n2344 PRINT AT A+I,T;W$(I)
\n2346 NEXT I
\n2348 PRINT "IS ANY WORD ";TAB O;"MIS-SPELLED - Y/N? "
\n2350 GOSUB 2920
\n2352 INPUT Y$
\n2354 PRINT AT Z,R+T;Y$
\n2356 IF Y$="N" THEN GOTO 2377
\n2357 IF Y$<>"Y" THEN GOTO 2352
\n2358 PRINT "TYPE NUMBER AND RE-TYPE WORD."
\n2359 LET EF=V
\n2360 INPUT X$
\n2361 LET W=O
\n2362 FOR I=V TO LEN X$
\n2363 IF NOT W AND (X$(I)<"1" OR X$(I)>"4") THEN GOTO 2370
\n2364 IF NOT W THEN LET W=VAL X$(I)
\n2365 IF X$(I)<"A" OR X$(I)>"Z" THEN GOTO 2370
\n2366 LET W$(W)=X$(I TO )
\n2367 LET W(W)=LEN X$-I+V
\n2368 LET I=LEN X$
\n2369 LET EF=O
\n2370 NEXT I
\n2371 IF NOT W THEN GOTO 2360
\n2372 IF EF THEN LET W$(W)=""
\n2373 IF EF THEN LET W(W)=0
\n2374 PRINT AT A+W,T;W$(W)
\n2375 PRINT AT Z-V,O;
\n2376 GOTO 2348
\n2377 PRINT AT Z,O;"CHALLENGED - Y/N? "
\n2378 GOSUB 2920
\n2379 INPUT Y$
\n2380 PRINT AT Z,Z-T;Y$
\n2381 IF Y$="N" THEN GOTO 2390
\n2382 IF Y$<>"Y" THEN GOTO 2377
\n2383 PRINT "IS IT IN THE DICTIONARY - Y/N? ";
\n2384 INPUT Y$
\n2385 PRINT AT Z+V,E+R;Y$
\n2386 IF Y$="Y" THEN GOTO 2390
\n2387 IF Y$<>"N" THEN GOTO 2384
\n2388 PRINT AT Z+V,O;"YOU LOST YOUR SCORE FOR THE TURN"
\n2389 RETURN
\n2390 GOSUB 2918
\n2392 FOR W=V TO F
\n2395 LET X$=""
\n2397 PRINT AT Z-V,O;"WORD NO. "
\n2398 PRINT AT Z-V,N;W
\n2399 IF NOT W(W) THEN GOTO 2460
\n2400 FAST
\n2401 FOR I=V TO W(W)
\n2402 IF W$(W,I)<"A" THEN GOTO 2406
\n2404 LET X$=X$+W$(W,I)
\n2406 NEXT I
\n2410 IF LEN X$>V THEN GOTO 2420
\n2412 PRINT "IS TOO SHORT; MUST ";TAB O;"BE AT LEAST 2 LETTERS. RE-TYPE."
\n2413 SLOW
\n2414 INPUT X$
\n2415 LET W$(W)=X$
\n2416 PRINT AT W+A,T;W$(W)
\n2417 LET W(W)=LEN X$
\n2418 GOSUB 2918
\n2419 GOTO 2395
\n2420 IF LEN X$<=G THEN GOTO 2430
\n2422 PRINT "IS TOO LONG; CANNOT";TAB O;"BE MORE THAN 6 LETTERS. RE-TYPE."
\n2426 GOTO 2413
\n2430 GOSUB 2500
\n2450 SLOW
\n2460 LET EF=O
\n2470 NEXT W
\n2475 IF S>O THEN GOTO 2490
\n2480 IF S(CP,F) THEN GOTO 2260
\n2490 PRINT AT Z-V,O;"TOTAL: "
\n2492 PRINT AT Z-V,N+(S<=N);S
\n2496 PRINT "SCORE FOR YOUR TURN"
\n2498 GOSUB 2920
\n2499 RETURN
\n2500 LET EF=V
\n2505 LET TS=O
\n2510 LET L=LEN X$
\n2515 LET K=O
\n2520 FOR I=K+V TO L
\n2525 IF CODE X$(I)=INT B(X,Y)-H*(B(X,Y)>Q) THEN LET EF=O
\n2530 IF NOT EF THEN LET K=I
\n2535 IF NOT EF THEN LET I=L
\n2540 NEXT I
\n2545 IF NOT K THEN GOTO 2700
\n2550 IF EF THEN GOTO 2710
\n2555 IF K=V THEN GOTO 2615
\n2560 FOR I=K-V TO V STEP -V
\n2565 IF W=F THEN GOTO 2590
\n2567 IF I+Y-K<V THEN GOTO 2595
\n2570 LET J=X+(K-I)*((W=T)-(W=U))
\n2575 IF J<V OR J>G THEN GOTO 2595
\n2580 IF INT B(J,I+Y-K)-H*(B(J,I+Y-K)>Q)<>CODE X$(I) THEN GOTO 2595
\n2585 GOTO 2605
\n2590 IF I+X-K<V THEN GOTO 2595
\n2592 IF INT B(I+X-K,Y)-H*(B(I+X-K,Y)>Q)=CODE X$(I) THEN GOTO 2605
\n2595 LET EF=V
\n2600 LET I=V
\n2605 NEXT I
\n2610 IF EF THEN GOTO 2520
\n2615 FOR I=V TO L
\n2620 IF W=F THEN GOTO 2650
\n2622 IF I+Y-K>G THEN GOTO 2665
\n2625 LET J=X+(K-I)*((W=T)-(W=U))
\n2627 IF I<=K THEN GOTO 2640
\n2630 IF J<V OR J>G THEN GOTO 2665
\n2635 IF INT B(J,I+Y-K)-H*(B(J,I+Y-K)>Q)<>CODE X$(I) THEN GOTO 2665
\n2640 LET TS=TS+R*(B(J,I+Y-K)-INT B(J,I+Y-K))
\n2645 GOTO 2680
\n2650 IF I+X-K>G THEN GOTO 2665
\n2652 IF INT B(I+X-K,Y)-H*(B(I+X-K,Y)>Q)<>CODE X$(I) THEN GOTO 2665
\n2655 LET TS=TS+R*(B(I+X-K,Y)-INT B(I+X-K,Y))
\n2660 GOTO 2680
\n2665 LET EF=V
\n2670 LET TS=O
\n2675 LET I=L
\n2680 NEXT I
\n2685 IF EF THEN GOTO 2520
\n2690 PRINT AT W+A,N;
\n2692 IF TS<=N THEN PRINT " ";
\n2694 PRINT TS
\n2696 LET S=S+TS
\n2699 RETURN
\n2700 PRINT AT Z,O;"MUST INCLUDE YOUR ";TAB O;"LETTER TO COUNT. RE-TYPE IT. "
\n2704 GOTO 2720
\n2710 PRINT AT Z,O;"DOES NOT MATCH WORD";TAB O;"ON THE BOARD. RE-TYPE IT. "
\n2720 INPUT X$
\n2722 LET W$(W)=X$
\n2724 LET W(W)=LEN X$
\n2726 PRINT AT A+W,T;W$(W)
\n2728 LET EF=O
\n2729 GOSUB 2918
\n2730 IF NOT W(W) THEN RETURN
\n2732 IF W(W)>V THEN GOTO 2500
\n2734 PRINT AT Z,O;"IS TOO SHORT; MUST ";TAB O;"BE AT LEAST 2 LETTERS. RE-TYPE."
\n2738 GOTO 2720
\n2800 LET B=O
\n2805 LET J=V
\n2810 FOR I=V TO P
\n2815 IF K=U THEN GOTO 2825
\n2820 LET S(I,U)=S(I,U)+S(I,T)
\n2825 IF S(I,K)>S(J,K) THEN LET J=I
\n2830 NEXT I
\n2835 FOR I=V TO P
\n2840 IF I=J THEN GOTO 2850
\n2845 IF S(I,K)=S(J,K) THEN LET B=V
\n2850 NEXT I
\n2899 RETURN
\n2900 PRINT AT E,O;"1 ";W$(V);TAB O;"2 ";W$(T);TAB O;"3 ";W$(U);TAB O;"4 ";W$(F)
\n2905 RETURN
\n2910 PRINT AT E,O;" ";TAB O;" ";TAB O;" ";TAB O;" "
\n2915 RETURN
\n2918 PRINT AT Z,O;"SCORING YOUR WORDS "
\n2920 PRINT AT Z+V,O;" "
\n2922 PRINT AT Z+V,O;
\n2924 RETURN
\n2930 SLOW
\n2932 IF INKEY$="" THEN GOTO 2932
\n2935 LET Y$=INKEY$
\n2937 FAST
\n2940 RETURN
\n2950 LET W$(V)="ACROSS"
\n2952 LET W$(T)="DIAG. UP"
\n2954 LET W$(U)="DIAG. DOWN"
\n2956 LET W$(F)="DOWN"
\n2958 RETURN
\n3000 CLS
\n3005 FAST
\n3010 PRINT "GAME OVER",,,,"PLAYER SCORE TOTAL"
\n3015 FOR I=V TO P
\n3020 PRINT I;" ";N$(I);TAB R-LEN STR$ S(I,T);S(I,T);TAB G+Z-LEN STR$ S(I,U);S(I,U)
\n3025 NEXT I
\n3030 PRINT AT A,O;"GAME WAS ";
\n3035 IF B THEN PRINT "DRAWN. "
\n3040 IF NOT B THEN PRINT "WON BY ";N$(J)
\n3045 LET CP=J+V
\n3050 SLOW
\n3099 RETURN
\n5000 SAVE "KARTI%K"
\n5010 GOTO 10
Note: Type-in program listings on this website use ZMAKEBAS notation for graphics characters.
