A computer search shows that "beefily" and "billowy" are the two longest words with letters in alphabetical order. If one doesn't like double letters (for strict monotonically increasing letter value), one letter shorter are "almost", "begins", "biopsy", "chimps", "chinos", "chintz" and "ghostly".
For reverse alphabetical order the longest is "trollied". One letter less avoids a double letter in "sponged" and "wronged".
The last "word" that the computer finds "in alphabetical order" is just "x". As there might be considered problems with that, the next-last is "tux", and after that (actually, before, in the alphabet), is "sty".
For reverse alphabetical order of its letters, the first word found is "a", whose letters are both in reverse alphabetic order as well as alphabetic order. The same quibble can be made about the second word found, "aa" (a type of lava). Then comes "ba", not too common a word. Then comes "ebb". The only problem for the purist here is the double letter. Then come "ed" (as in "sex ed" or "driver's ed") and "fa" (a note on the diatonic scale--or a long, long way to run in the Sound of Music). But a word that all can agree is common enough is "fed".
The program is:
wdLim = 25
REDIM save$(wdLim)
OPEN "words.txt" FOR INPUT AS #1
DO
LINE INPUT #1, l$
IF LCASE$(l$) = l$ THEN
good = 1
FOR i = 2 TO LEN(l$)
IF MID$(l$, i, 1) < MID$(l$, i - 1, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
IF LEN(l$) > 5 THEN
PRINT l$
END IF
IF LEN(l$) > LEN(save$(wdLim)) THEN
FOR i = 1 TO wdLim
IF LEN(l$) > LEN(save$(i)) THEN
FOR j = i TO wdLim
SWAP save$(j), l$
NEXT
EXIT FOR
END IF
NEXT
END IF
END IF
END IF
LOOP UNTIL EOF(1)
'FOR i = 1 TO 25
' PRINT save$(i)
'NEXT
CLOSE
wdLim = 25
REDIM save$(wdLim)
OPEN "words.txt" FOR INPUT AS #1
DO
LINE INPUT #1, l$
IF LCASE$(l$) = l$ THEN
good = 1
FOR i = 2 TO LEN(l$)
IF MID$(l$, i, 1) > MID$(l$, i - 1, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
IF LEN(l$) > 6 THEN PRINT l$
IF LEN(l$) > LEN(save$(wdLim)) THEN
FOR i = 1 TO wdLim
IF LEN(l$) > LEN(save$(i)) THEN
FOR j = i TO wdLim
SWAP save$(j), l$
NEXT
EXIT FOR
END IF
NEXT
END IF
END IF
END IF
LOOP UNTIL EOF(1)
'FOR i = 1 TO 25
' PRINT save$(i)
'NEXT
CLOSE
wdLim = 25
REDIM save$(wdLim)
OPEN "words.txt" FOR INPUT AS #1
DO
LINE INPUT #1, l$
IF LCASE$(l$) = l$ THEN
good = 1
FOR i = 2 TO LEN(l$)
IF MID$(l$, i, 1) < MID$(l$, i - 1, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
FOR j = 1 TO wdLim
SWAP save$(j), l$
NEXT
END IF
END IF
LOOP UNTIL EOF(1)
FOR i = 1 TO wdLim
PRINT save$(i)
NEXT
CLOSE
wdLim = 25
REDIM save$(wdLim)
OPEN \"words.txt\" FOR INPUT AS #1
wCt = 0
DO
LINE INPUT #1, l$
IF LCASE$(l$) = l$ THEN
good = 1
FOR i = 2 TO LEN(l$)
IF MID$(l$, i, 1) > MID$(l$, i - 1, 1) THEN good = 0: EXIT FOR
NEXT
IF good THEN
wCt = wCt + 1
IF wCt <= wdLim THEN
save$(wCt) = l$
END IF
END IF
END IF
LOOP UNTIL EOF(1)
FOR i = 1 TO wdLim
PRINT save$(i)
NEXT
CLOSE
|
Posted by Charlie
on 2004-02-08 11:09:34 |