DEFDBL A-Z
CLS
FOR s = 1 TO 9
used(s) = 1
FOR f = 1 TO 9
IF used(f) = 0 THEN
used(f) = 1
FOR b = 0 TO 9
IF used(b) = 0 THEN
used(b) = 1
fsbs = 1000 * f + 101 * s + 10 * b
FOR a = 0 TO 9
IF used(a) = 0 THEN
used(a) = 1
FOR d = 0 TO 9
IF used(d) = 0 THEN
used(d) = 1
FOR o = 0 TO 9
IF used(o) = 0 THEN
used(o) = 1
fado = 1000 * f + 100 * a + 10 * d + o
FOR l = 0 TO 9
IF used(l) = 0 THEN
used(l) = 1
FOR e = 0 TO 9
IF used(e) = 0 THEN
used(e) = 1
floobles = 10000000 * f + 1000100 * l + 110000 * o + 1000 * b + 10 * e + s
IF floobles = s * fsbs * fado THEN
PRINT floobles; s; fsbs; fado
s$ = "2 534 31 1274 1338"
FOR i = 1 TO LEN(s$)
v = VAL(MID$(s$, i, 1))
IF MID$(s$, i, 1) = " " THEN v = -99
SELECT CASE v
CASE s: PRINT "s";
CASE f: PRINT "f";
CASE b: PRINT "b";
CASE a: PRINT "a";
CASE d: PRINT "d";
CASE o: PRINT "o";
CASE l: PRINT "l";
CASE e: PRINT "e";
CASE -99: PRINT " ";
CASE ELSE: PRINT "_";
END SELECT
NEXT
PRINT : PRINT
END IF
used(e) = 0
END IF
NEXT
used(l) = 0
END IF
NEXT
used(o) = 0
END IF
NEXT
used(d) = 0
END IF
NEXT
used(a) = 0
END IF
NEXT
used(b) = 0
END IF
NEXT
used(f) = 0
END IF
NEXT
used(s) = 0
NEXT
Finds two mathematical solutions to the alphametic:
FLOOBLES S FSBS FADO
15330567 7 1707 1283
a lo_ of fas_ food
15774528 8 1848 1067
e l_b _f feob f__s
Only the first one allows a coherent decoding of the answer: A lot of fast food, with the mathematically unassigned 4 being assigned to the letter T.
|
Posted by Charlie
on 2013-10-04 19:51:51 |