CONST MinLength
= 4, MaxLength
= 10
File$ = "kjv10.txt" 'the King James Version 10 of the bible, from Project Gutenberg
PRINT "Processing book..."
LoadLists File$
PRINT "There are a total of"; WordCount
(0);
" words in our book."
FilterLists
PRINT "After we filter to exclude words too short, or too long, we have"; WordCount
(0);
" words left."
SortByWord
SortByFrequency
FOR i
= 1 TO WordCount
(0) PRINT Words
(i
); WordCount
(i
),
temp$ = "The user was too lazy to provide us any word lists to choose from, so this is the default choices which were insterted into the program by Steve, just because he wanted something to work with, even if the end user might be a smart ass like Pete pretends to be sometimes."
l = 0
l = 0
skipcheck:
i = 1
word$
= LEFT$(word$
, i
- 1) + MID$(word$
, i
+ 1) i = i + 1
newword = -1
u = u + 1
Words(u) = word$: WordCount(u) = 1
WordCount(i) = WordCount(i) + 1
oldl = l + 1
oldl = oldl + 1
WordCount(0) = u
FOR i
= 1 TO WordCount
(0) 'it doesn't fit our length criteria to be a "good word"
goodword = goodword + 1
Words(goodword) = Words(i)
WordCount(goodword) = WordCount(i)
WordCount(0) = goodword
'This is the routine I tend to use personally and promote.
'It's short, simple, and easy to implement into code.
gap = WordCount(0)
index = WordCount(0)
gap
= INT(gap
/ 1.247330925103979) i = 1
swapped = 0
IF Words
(i
) > Words
(i
+ gap
) THEN SWAP Words
(i
), Words
(i
+ gap
) SWAP WordCount
(i
), WordCount
(i
+ gap
) swapped = -1
i = i + 1
'This is the routine I tend to use personally and promote.
'It's short, simple, and easy to implement into code.
gap = WordCount(0)
index = WordCount(0)
gap
= INT(gap
/ 1.247330925103979) i = 1
swapped = 0
IF WordCount
(i
) > WordCount
(i
+ gap
) THEN SWAP Words
(i
), Words
(i
+ gap
) SWAP WordCount
(i
), WordCount
(i
+ gap
) swapped = -1
i = i + 1