My password is an English noun, consisting of five distinct letters.
It has no common letters with either
DIZZY
or
STORM
and shares two letters with the word
PLACE and two letters with the word
PURGE.
a. Find my password.
b. Is it the only word that fits the description?
OPEN "\words\words5.txt" FOR BINARY AS #1
CLS
w$ = SPACE$(5)
DO
GET #1, , w$
IF EOF(1) THEN EXIT DO
good = 1
FOR i = 1 TO 5
IF INSTR("dizystorm", MID$(w$, i, 1)) THEN good = 0: EXIT FOR
NEXT
FOR i = 1 TO 4
IF INSTR(MID$(w$, i + 1), MID$(w$, i, 1)) > 0 THEN good = 0: EXIT FOR
NEXT
IF good THEN
ct1 = 0: ct2 = 0
FOR i = 1 TO 5
IF INSTR("place", MID$(w$, i, 1)) THEN ct1 = ct1 + 1
IF INSTR("purge", MID$(w$, i, 1)) THEN ct2 = ct2 + 1
NEXT
IF ct1 = 2 AND ct2 = 2 THEN
PRINT w$
END IF
END IF
LOOP UNTIL EOF(1)
finds
beaux
began
clung
fauve
fluke
fugal
ganef
ganev
gulch
jugal
laugh
plunk
pujah
punch
punka
quake
quean
vegan
whaup
of which fluke, gulch, laugh, punch, quake and vegan could be considered common English nouns.
PUNCH and QUAKE have the added property that the two letters shared with each of PLACE and PURGE are in the correct position in each.
|
Posted by Charlie
on 2010-09-01 02:49:18 |