The following was originally a list of five-letter words, but in each case two consecutive letters (though never the first two) have been removed. The 26 missing letters are all different. What was the original list?
A N T
A S S
B A Y
C O Y
D I M
E E L
F A R
M A R
P I E
S E E
T I E
T O P
W I N
DECLARE SUB build (n!)
CLEAR , , 25000
CLS
DATA ant,ass,bay,coy,dim,eel,far,mar,pie,see,tie,top,win
DIM SHARED wd3(13) AS STRING
DIM SHARED letct(13)
DIM SHARED extlet(13, 40) AS STRING, h AS STRING, histNo(13), orig(13, 40) AS STRING
FOR i = 1 TO 13: READ wd3(i): NEXT
OPEN "\words\words5.txt" FOR BINARY AS #1
w$ = SPACE$(5)
DO
GET #1, , w$
IF EOF(1) THEN EXIT DO
w1$ = LEFT$(w$, 1) + MID$(w$, 4)
w2$ = LEFT$(w$, 2) + MID$(w$, 5)
w3$ = LEFT$(w$, 3)
FOR i = 1 TO 13
IF w1$ = wd3(i) THEN
letct(i) = letct(i) + 1
extlet(i, letct(i)) = MID$(w$, 2, 2)
orig(i, letct(i)) = w$
END IF
IF w2$ = wd3(i) THEN
letct(i) = letct(i) + 1
extlet(i, letct(i)) = MID$(w$, 3, 2)
orig(i, letct(i)) = w$
END IF
IF w3$ = wd3(i) THEN
letct(i) = letct(i) + 1
extlet(i, letct(i)) = MID$(w$, 4, 2)
orig(i, letct(i)) = w$
END IF
NEXT
LOOP
CLOSE
FOR i = 1 TO 13: PRINT letct(i); : NEXT: PRINT
PRINT
build 1
SUB build (n)
FOR i = 1 TO letct(n)
s$ = extlet(n, i)
IF LEFT$(s$, 1) <> RIGHT$(s$, 1) THEN
good = 1
FOR j = 1 TO 2
IF INSTR(h, MID$(s$, j, 1)) > 0 THEN good = 0
NEXT
ELSE
good = 0
END IF
IF good THEN
h = h + s$: histNo(n) = i
IF LEN(h) = 26 THEN
FOR j = 1 TO 13
PRINT orig(j, histNo(j)) + " ";
NEXT
PRINT
FOR j = 1 TO 25 STEP 2
PRINT MID$(h, j, 2) + " ";
NEXT
PRINT : PRINT
ELSE
build n + 1
END IF
h = LEFT$(h, LEN(h) - 2)
END IF
NEXT
END SUB
first shows the number of possible possible letter pairs that could be used in combination with the given words, in order:
16 13 21 23 4 3 23 26 10 25 8 13 16
Then, the possible answers, with the inserted letter pair shown below each 5-letter word:
angst abyss bawdy comfy denim expel fakir major pique serve title topaz winch
gs by wd mf en xp ki jo qu rv tl az ch
angst abyss bawty comfy denim expel fakir major pique serve tilde topaz winch
gs by wt mf en xp ki jo qu rv ld az ch
|
Posted by Charlie
on 2013-04-30 16:09:22 |