OPEN "\words\words4.txt" FOR BINARY AS #1
src$ = "abceiknors": h$ = src$
DO
w1$ = MID$(src$, 10, 1) + MID$(src$, 1, 1) + MID$(src$, 3, 1) + MID$(src$, 4, 1)
IF isWord(w1$) THEN
w2$ = MID$(src$, 10, 1) + MID$(src$, 9, 1) + MID$(src$, 7, 1) + MID$(src$, 6, 1)
IF isWord(w2$) THEN
w3$ = MID$(src$, 2, 1) + MID$(src$, 3, 1) + MID$(src$, 5, 1) + MID$(src$, 6, 1)
IF isWord(w3$) THEN
w4$ = MID$(src$, 2, 1) + MID$(src$, 1, 1) + MID$(src$, 9, 1) + MID$(src$, 8, 1)
IF isWord(w4$) THEN
w5$ = MID$(src$, 8, 1) + MID$(src$, 7, 1) + MID$(src$, 5, 1) + MID$(src$, 4, 1)
IF isWord(w5$) THEN
PRINT w1$, w2$, w3$, w4$, w5$
PRINT
END IF
END IF
END IF
END IF
END IF
permute src$
LOOP UNTIL h$ = src$
CLOSE
DEFLNG A-Z
FUNCTION isWord (w$)
n = LEN(w$)
w1$ = SPACE$(n)
l = LOF(1) / n
low = 1: high = l
DO
mid = INT((low + high) / 2)
GET #1, (mid - 1) * n + 1, w1$
IF w1$ = w$ THEN isWord = -1: EXIT FUNCTION
IF w1$ < w$ THEN low = mid + 1: ELSE high = mid - 1
LOOP UNTIL low > high
isWord = 0
END FUNCTION
finds four solutions:
0134 0976 2356 2198 8754
bank brie once oars sick
beak bris cans cero oink
corn cake brie boas skin
boas brie cane cork kins
Only CERO is an unusual word; also KINS as a plural.
cero: a large Atlantic and Gulf Coast mackerel game fish, Scomberomorus regalis.
kins is listed in http://homepage.ntlworld.com/adam.bozon/Scrabble4.htm, a site that was found Googling scrabble words.
|
Posted by Charlie
on 2011-12-18 13:28:17 |