Below is a program I whipped up to show how you can generate a list of
all possible syllables using BASIC. It took about 8 minutes to write
this, which shows how easy BASIC is to use. Feel free to modify this
and use it however you wish. Obvioulsy doing all possible _words_ would
be more complex than doing all possible syllables, but you have to
start somewhere...
REM * this program generates all possible syllables *
REM * first we create arrays to hold our strings *
DIM a$(50)
DIM b$(50)
DIM c$(50)
REM * put permitted initial consonants into a$ array *
Initials:
READ y$
IF y$ = "xxx" THEN GOTO Vowels
counta = counta + 1
a$(counta) = y$
GOTO Initials
REM * put permitted vowels into b$ array *
Vowels:
READ y$
IF y$ = "xxx" THEN GOTO Finals
countb = countb + 1
b$(countb) = y$
GOTO Vowels
REM * put permitted finals into b$ array *
Finals:
READ y$
IF y$ = "xxx" THEN GOTO Wrap
countc = countc + 1
c$(countc) = y$
GOTO Finals
REM * create the syllables and output them to a textfile *
Wrap:
OPEN "syllables.txt" FOR OUTPUT AS #1
FOR i = 1 TO counta
FOR j = 1 TO countb
FOR k = 1 TO countc
sa$ = a$(i)
sb$ = b$(j)
sc$ = c$(k)
IF sc$ = "zero" THEN sc$ = ""
syllable$ = sa$ + sb$ + sc$
PRINT #1, syllable$
NEXT k
NEXT j
NEXT i
CLOSE #1
PRINT "Finished. It was a pleasure to serve you."
END
REM * below is where the intials, medials, and finals are stored *
REM * xxx marks the end of each list *
DATA b, ch, d, xxx
DATA a, i, u, xxx
DATA zero, n, s, xxx
- - - - - that's the end of the program - - - - -
- - - - - below is what the output file looks like - - - - -
ba
ban
bas
bi
bin
bis
bu
bun
bus
cha
chan
chas
chi
chin
chis
chu
chun
chus
da
dan
das
di
din
dis
du
dun
dus


|