home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Nibble Magazine
/
nib31b.dsk
/
SIMPLE.SPELLER.bas
< prev
next >
Wrap
BASIC Source File
|
2023-02-26
|
2KB
|
59 lines
1 REM ************************
2 REM * SIMPLE.SPELLER *
3 REM * BY ROB SMYTHE *
4 REM * COPYRIGHT (C) 1987 *
5 REM * BY MICROSPARC, INC. *
6 REM * CONCORD, MA 01742 *
7 REM ************************
100 HOME : PRINT TAB( 6)"S I M P L E S P E L L E R"
110 PRINT : PRINT TAB( 6)"===========================": PRINT TAB( 3)"COPYRIGHT 1987 BY MICROSPARC, INC."
120 DIM W$(100): REM MAXIMUM # WORDS
130 G$ = CHR$(7): REM MAKE IT CHR$(0) IF YOU DON'T WANT SOUND
140 :
150 REM READ IN WORDS FROM LIST
160 REM MAKE LAST WORD "QUIT"
170 :
180 I = I +1: READ W$(I): IF W$(I) < >"QUIT" THEN 180
190 N = I: REM N=NUMBER OF WORDS
200 :
210 REM ** START NEW WORD **
220 :
230 VTAB 10: HTAB 15: CALL -958
240 COUNT = 1:N$ = "":W = 0
250 GET A$: REM KEYPRESS
260 IF A$ = "?" OR A$ = "/" THEN A$ = MID$ (W$(W),COUNT,1): REM HINT
270 :
280 REM CHECK EACH WORD FOR MATCH
290 :
300 NN$ = N$ +A$: REM TRIAL PARTIAL WORD
310 FOR I = 1 TO N: REM FOR EACH WORD...
320 LT$ = LEFT$(W$(I),COUNT): REM TARGET PARTIAL WORD
330 IF NN$ < >LT$ THEN NEXT I: GOTO 250: REM NO MATCH - TRY AGAIN
340 :
350 REM A$ MAKES A POSSIBLE WORD
360 :
370 W = I: REM REMEMBER WHICH POSSIBLE WORD
380 PRINT G$A$" ";:N$ = N$ +A$:J = I:I = N: NEXT I
390 IF COUNT = LEN(W$(J)) THEN 440: REM END OF A WORD?
400 COUNT = COUNT +1: GOTO 250: REM GET NEXT LETTER
410 :
420 REM WORD IS COMPLETE
430 :
440 PRINT G$G$G$G$: VTAB 10: HTAB 15: CALL -958: FOR I = 1 TO 300: NEXT : VTAB 10: HTAB 15
450 FOR I = 1 TO COUNT: PRINT MID$ (W$(J),I,1);G$;" ";
460 FOR K = 1 TO 200: NEXT
470 NEXT I
480 FOR K = 1 TO 2000: NEXT
490 IF J < >N THEN 230: REM LAST WORD?
500 VTAB 10: HTAB 12: PRINT "G O O D - B Y E"
510 VTAB 20: END
520 :
530 :
540 REM PUT WORDS HERE.
550 REM MAKE LAST WORD "QUIT"
560 :
570 DATA DADDY,MOMMY,DEBBIE,DUSTY,LESLEY,RYAN,GRAMMA,GRAMPA,NANA
580 DATA SANDRA,JENNIFER,JILLIAN,DOG,BABY,CAT
590 DATA CAR,GOOD,BOOK,HE,SHE,LOOK,HERE,MAT,HAT,SAT,AT,THE
600 DATA IS,AM,YOU,WE,ME,MY,HUG
610 DATA QUIT