For j
= 1 To (1 + Rnd * 9) 'create a totally random 1-10 letter word word
(i
) = word
(i
) + Chr$(Rnd * 26 + 65) 'these "words" are made up of 5 random letters index(i) = i 'point the initial index to the words as they currently exist
PRINT "Give me 10 words to store for you (#"; i;
"of ";max;
"10) =>";
INPUT word
(i
) 'Get any ";max;" words which you might like from the user index(i) = i 'point the initial index to the words as they currently exist
'copy the intial index
indexLENmin(a) = index(a)
'sort by index A-Z
If word
(index
(i
)) < word
(index
(j
)) Then Swap index
(i
), index
(j
)
'sort by index Z-A
' no needed because it is the reverse of Z-A
'sort by index Lenght of word from the shortest to longestest
If Len(word
(indexLENmin
(i
))) > Len(word
(indexLENmin
(j
))) Then Swap indexLENmin
(i
), indexLENmin
(j
)
' sort by index length of word from the longest to te shortest
' no needed because it is the reverse of from the shortest to the longest
Print " ";
"Original";
" ";
"Sorted A-Z";
" ";
"Sorted Z-A";
" ";
"by Shortest";
" ";
"by Longest"