The program:
DEFDBL AZ
OPEN "8primesb.txt" FOR INPUT AS #1
'OPEN "8primes2.txt" FOR OUTPUT AS #2
mindiffdg = 999
CLS
DO
LINE INPUT #1, l$
a$ = MID$(l$, 2, 3)
b$ = MID$(l$, 7, 3)
c$ = MID$(l$, 12, 3)
a1 = VAL(LEFT$(a$, 1)): a2 = VAL(MID$(a$, 2, 1)): a3 = VAL(RIGHT$(a$, 1))
b1 = VAL(LEFT$(b$, 1)): b2 = VAL(MID$(b$, 2, 1)): b3 = VAL(RIGHT$(b$, 1))
c1 = VAL(LEFT$(c$, 1)): c2 = VAL(MID$(c$, 2, 1)): c3 = VAL(RIGHT$(c$, 1))
IF a3 + b2 + c1 = 4 THEN
IF a1 + a2 + a3 = 11 THEN
IF b1 + b2 + b3 = 17 THEN
IF c1 + c2 + c3 = 5 THEN
PRINT a$: PRINT b$: PRINT c$
ct = ct + 1
END IF
END IF
END IF
END IF
LOOP UNTIL EOF(1)
CLOSE 1
'CLOSE 2
PRINT ct
goes through the output from the original program and finds:
641
809
311
Note that it was not necessary to check every total. The requirements were added as necessary to narrow the answer to one solution.

Posted by Charlie
on 20131015 20:42:09 