home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.barnyard.co.uk
/
2015.02.ftp.barnyard.co.uk.tar
/
ftp.barnyard.co.uk
/
cpm
/
walnut-creek-CDROM
/
CPM
/
EDUCATIN
/
HEBREW.LBR
/
SORT.BZS
/
SORT.BAS
Wrap
BASIC Source File
|
2000-06-30
|
8KB
|
252 lines
100 REM ***********************************************************
110 REM * DABAR 1.0 *
150 REM * HEBREW VOCABULARY DRILL SYSTEM *
175 REM * SPECIAL SORT & PRINT *
200 REM * *
250 REM * COPYRIGHT 1986 BY DANIEL R. CRIDER *
300 REM * THIS PROGRAM IS RELEASED INTO THE PUBLIC DOMAIN *
350 REM * ON A SHAREWARE BASIS. PLEASE SEND $10 TO DANIEL CRIDER *
400 REM * FOR THE RIGHT TO USE THIS PROGRAM. THIS PROGRAM IS NOT *
450 REM * TO BE RE-SOLD OR RE-RELEASED WITH ANY COMMERCIAL *
470 REM * PRODUCT OR PACKAGE *
500 REM * FOR NOTICE OF OTHER RIGHTS AND RESTRICTIONS PLEASE *
550 REM * SEE THE FILE HEBREW.DOC WHICH SHOULD BE SUPPLIED WITH *
600 REM * THIS PROGRAM. PLEASE MAIL YOUR PAYMENT AND ANY COMMENTS *
950 REM * TO: *
1000 REM * *
1050 REM * DANIEL CRIDER *
1070 REM * 6604 CERVANTES *
1100 REM * FT. WORTH, TEXAS 76133 *
1150 REM * *
1600 REM ************ SET UP ARRAYS
1650 DIM LI(30),US(30)
1700 ML=0
1750 DIM W$(9),W1$(9),W2$(9),WD(3,9)
1800 DIM CONS$(44,7), CN$(23)
1850 DIM VOW$(12,3)
1900 DIM FIN$(4,10)
1950 GOSUB 4750
2000 REM ************ LOAD ALPHABET
2005 PRINT
2010 PRINT TAB(36);"DABAR 1.0"
2020 PRINT
2030 PRINT TAB(24);"COPYRIGHT 1986 BY DANIEL R. CRIDER"
2040 PRINT
2050 OPEN "I",1,"LETTERS.BAS"
2100 FOR I=1 TO 44
2150 PRINT "PLEASE STANDBY.....LOADING HEBREW CONSONANTS ";I
2200 GOSUB 5150
2250 FOR J=1 TO 7
2300 LINE INPUT#1,AX$
2350 CONS$(I,J)=MID$(AX$,13,8)
2400 NEXT J
2450 NEXT I
2500 PRINT
2550 FOR I=1 TO 12
2600 PRINT "...................LOADING HEBREW VOWELS ";I
2650 GOSUB 5150
2700 FOR J=1 TO 3
2750 LINE INPUT#1,AX$
2800 VOW$(I,J)=MID$(AX$,13,8)
2850 NEXT J
2900 NEXT I
2950 PRINT
3000 FOR I=1 TO 4
3050 PRINT "...................LOADING SPECIAL CHARACTERS ";I
3100 GOSUB 5150
3150 FOR J=1 TO 10
3200 LINE INPUT#1,AX$
3250 FIN$(I,J)=MID$(AX$,13,8)
3300 NEXT J
3350 NEXT I
3400 CLOSE #1
3450 FOR I=1 TO 23:READ CN$(I):NEXT I
3500 PRINT
3550 PRINT
3750 REM ************ OPEN VOCABULARY FILE
3800 PRINT
3850 PRINT "PLEASE STANDBY...SCANNING VOCABULARY FILE"
3900 OPEN "R",#1,"VOCAB",124
3950 FIELD #1,2 AS W$(1),2 AS W$(2),2 AS W$(3),2 AS W$(4),2 AS W$(5),2 AS W$(6),2 AS W$(7),2 AS W$(8),2 AS W$(9),106 AS Y$
4000 FIELD #1,18 AS Y3$,2 AS W1$(1),2 AS W1$(2),2 AS W1$(3),2 AS W1$(4),2 AS W1$(5),2 AS W1$(6),2 AS W1$(7),2 AS W1$(8),2 AS W1$(9),88 AS Y5$
4050 FIELD #1,36 AS Y4$,2 AS W2$(1),2 AS W2$(2),2 AS W2$(3),2 AS W2$(4),2 AS W2$(5),2 AS W2$(6),2 AS W2$(7),2 AS W2$(8),2 AS W2$(9),70 AS DF$
4100 LR=1
4150 DL=0
4200 GET #1,LR
4250 IF EOF(1) GOTO 4500
4300 WD(2,1)=CVI(W1$(1))
4350 IF WD(2,1)=99 THEN DL=DL+1
4400 LR=LR+1
4450 GOTO 4200
4500 LR=LR-1
4550 GOTO 5850
4600 REM ************ RING BELL CODE
4650 PRINT CHR$(7);CHR$(7);
4700 RETURN
4750 REM ************ CLEAR SCREEN CODE
4850 PRINT CHR$(26)
4900 RETURN
5150 REM ************ CURSOR UP SCREEN CODE
5250 PRINT CHR$(11);
5300 RETURN
5500 REM ************ CURSOR DOWN SCREEN CODE
5600 PRINT CHR$(10);
5650 RETURN
5850 REM ************ DISPLAY MENU
5900 SU=0
5950 GOSUB 4750
6000 PRINT TAB(22);"CURRENTLY ";LR-DL;" VOCABULARY WORDS ON FILE"
6050 PRINT
6100 PRINT
6150 PRINT TAB(34);"DABAR V. 1.0"
6160 PRINT TAB(25);"HEBREW VOCABULARY DRILL SYSTEM"
6175 PRINT TAB(35);"MASTER MENU"
6200 PRINT
6500 PRINT TAB(25);"1-- SORT AND PRINT VOCABULARY"
6600 PRINT TAB(25);"2-- END PROGRAM"
6650 PRINT
6700 PRINT
6750 PRINT TAB(28);"PLEASE ENTER YOUR CHOICE ";
6800 INPUT M
6850 IF M>2 OR M<1 THEN 6750
6900 ON M GOTO 32200,6950
6950 REM ************ END PROGRAM
7000 PRINT "READY TO QUIT? (Y OR N) ";
7050 INPUT X$
7100 IF X$<>"Y" AND X$<>"N" THEN 7000
7150 IF X$="N" THEN 5850
7200 CLOSE #1
7250 SYSTEM
23300 REM ************ READ A WORD *************************
23350 GET #1, TR
23400 FOR I=1 TO 9
23450 WD(1,I)=CVI(W$(I))
23500 WD(2,I)=CVI(W1$(I))
23550 WD(3,I)=CVI(W2$(I))
23600 NEXT I
23650 IF WD(2,1)=99 THEN TR=TR+1:GOTO 23350
23700 RETURN
32200 REM ************ PRINT ENTIRE VOCABULARY
32250 PRINT "DO YOU WISH TO PRINT OUT THE ENTIRE VOCABULARY? (Y OR N)";
32300 INPUT AX$
32350 IF AX$<>"Y" AND AX$<>"N" THEN 32250
32400 BV=1: LV=LR:IP=0
32450 IF AX$="Y" THEN 32850
32500 PRINT "DO YOU WISH TO PRINT OUT PART OF THE VOCABULARY? (Y OR N)";
32550 INPUT AX$
32600 IF AX$<>"Y" AND AX$<>"N" THEN 32500
32650 IF AX$="N" THEN 5850
32700 INPUT "ENTER FIRST WORD NUMBER TO LIST ";BV
32750 INPUT "ENTER LAST WORD NUMBER TO LIST ";LV
32800 GOTO 33050
32850 PRINT "DO YOU WANT A SORTED LISTING? ";
32900 INPUT AX$
32950 IF AX$<>"Y" AND AX$<>"N" THEN 32850
33000 IF AX$="Y" THEN 33300
33050 FOR TR=BV TO LV
33100 GOSUB 23300
33150 GOSUB 34950
33200 NEXT TR
33250 GOTO 5850
33300 REM ************ SORT ROUTINE **********************
33350 GOSUB 4750:PRINT "STANDBY FOR SORT (THIS MAY TAKE A WHILE)"
33400 DIM SO$(LR), SO(LR)
33450 FOR TR=1 TO LR
33500 GOSUB 23300:PRINT "RECORD ";TR:GOSUB 5150
33550 FOR I=1 TO 8
33600 IF WD(2,I)=43 AND WD(2,I+1)=43 THEN WL=I-1:GOTO 33700
33650 NEXT I
33700 CD$="":FOR I=WL TO 1 STEP -1
33750 Z=WD(2,I)
33755 IF Z=24 THEN Z=22
33760 ZX=Z+65
33800 IF Z=43 THEN ZX=64
33850 CD$=CD$+CHR$(ZX)
33900 NEXT I
33950 SO$(TR)=CD$:SO(TR)=TR
34000 NEXT TR
34050 PRINT
34100 PRINT "FIRST PASS COMPLETE, BEGINNING SECOND PASS":PRINT
34150 FOR I=1 TO LR-1
34200 FOR J=1 TO LR-1
34250 IF SO$(J)<SO$(J+1) THEN 34500
34300 TP$=SO$(J):TP=SO(J)
34350 SO$(J)=SO$(J+1):SO(J)=SO(J+1)
34400 SO$(J+1)=TP$:SO(J+1)=TP
34450 GOSUB 5150:PRINT "I= ";I;" J= ";J
34500 NEXT J:NEXT I
34550 PRINT "SORT COMPLETE....BEGINNING PRINTOUT"
34600 FOR SI=1 TO LR
34650 TR=SO(SI)
34700 GOSUB 23300:GOSUB 34950
34750 NEXT SI
34800 LPRINT CHR$(12);CHR$(12)
34850 ERASE SO$, SO
34900 GOTO 5850
34950 REM ************ PRINT A WORD ROUTINE
35000 IP=IP+1
35050 IF IP<>4 THEN 35200
35100 IP=1:LPRINT STRING$(70,"*")
35150 FOR IZ=1 TO 17:LPRINT:NEXT IZ
35200 LPRINT STRING$(70,"*")
35250 LPRINT "WORD NUMBER ";TR;" DEFINITION IS "
35300 LPRINT DF$
35350 Z=WD(2,1)
35400 LPRINT " ";
35450 FOR I=1 TO 9
35500 Z=WD(1,I)
35550 LPRINT VOW$(Z,3);
35600 NEXT I
35650 LPRINT
35700 FOR J=1 TO 7
35750 FOR I=0 TO 9
35800 Z=WD(2,I)
35850 IF I<>0 THEN 36400
35900 Z2=WD(2,1)
35950 IF Z2<>18 AND Z2<>25 AND Z2<>30 AND Z2<>32 THEN 36350
36000 Z2=WD(3,1)
36050 IF J<4 OR J>6 THEN 36350
36100 Z3$=VOW$(Z2,J-3)
36150 Z4$=MID$(Z3$,4,3)
36200 LPRINT Z4$;
36250 GOTO 36400
36300 Z=WD(2,1)
36350 LPRINT " ";
36400 IF I<>1 THEN 36750
36450 IF Z<>18 AND Z<>25 AND Z<>30 AND Z<>32 THEN 36750
36500 IF Z=18 THEN LPRINT FIN$(1,J);
36550 IF Z=25 THEN LPRINT FIN$(2,J);
36600 IF Z=30 THEN LPRINT FIN$(3,J);
36650 IF Z=32 THEN LPRINT FIN$(4,J);
36700 GOTO 36800
36750 LPRINT CONS$(Z,J);
36800 NEXT I
36850 LPRINT
36900 NEXT J
36950 FOR J=0 TO 3
37000 FOR I=0 TO 9
37050 Z2=WD(3,I)
37100 IF I<>0 THEN 37250
37150 LPRINT " ";
37200 GOTO 37750
37250 IF I<>1 THEN GOTO 37650
37300 Z=WD(2,1)
37350 IF Z<>18 AND Z<>25 AND Z<>30 AND Z<>32 THEN 37650
37400 IF Z=18 THEN LPRINT FIN$(1,J+7);
37450 IF Z=25 THEN LPRINT FIN$(2,J+7);
37500 IF Z=30 THEN LPRINT FIN$(3,J+7);
37550 IF Z=32 THEN LPRINT FIN$(4,J+7);
37600 GOTO 37750
37650 IF J=0 THEN LPRINT " ";
37700 IF J<>0 THEN LPRINT VOW$(Z2,J);
37750 NEXT I
37800 LPRINT
37850 NEXT J
37900 LPRINT
37950 RETURN
45050 DATA "ALEP","BET","GIMEL","DALET","HE","WAW","ZAYIN","HET","TET","YOD"
45100 DATA "KAP","LAMED","MEM","NUN","SAMEK","AYIN","PE","SADE","KOP","RES"
45150 DATA "SEEN","SHEEN","TAW"
ET","TET","YOD"
45100 DATA "KAP","LAMED","MEM","NUN","SAMEK","AYIN","PE","SADE","KOP","RES"
45150 DATA "SEEN","