Check this out first:
http:
//members.iinet.net.au
/~brianjnow /perplexus /Perplexians.html (delete all spaces)Following advice the program listing was adjusted and then a few minor utility lines were added to give this print-out:
W1 worm 8915
W2 lamb 7453
W3 race 1462
W4 moor 5991
OPEN "c:qb64workproverbs.txt" FOR OUTPUT AS #1
FOR a = 0 TO 9
IF used(a) = 0 THEN
used(a) = 1
FOR b = 0 TO 9
IF used(b) = 0 THEN
used(b) = 1
FOR c = 0 TO 9
IF used(c) = 0 THEN
used(c) = 1
FOR e = 0 TO 9
IF used(e) = 0 THEN
used(e) = 1
FOR l = 1 TO 9
IF used(l) = 0 THEN
used(l) = 1
FOR m = 1 TO 9
IF used(m) = 0 THEN
used(m) = 1
FOR o = 0 TO 9
IF used(o) = 0 THEN
used(o) = 1
FOR r = 1 TO 9
IF used(r) = 0 THEN
used(r) = 1
FOR w = 1 TO 9
IF used(w) = 0 THEN
used(w) = 1
w1 = w * 1000 + o * 100 + r * 10 + m
w2 = l * 1000 + a * 100 + m * 10 + b
w3 = r * 1000 + a * 100 + c * 10 + e
w4 = m * 1000 + o * 100 + o * 10 + r
IF w1 = w3 + w2 AND w4 = w2 - w3 THEN
PRINT "W1"; w1
PRINT "W2"; w2
PRINT "W3"; w3
PRINT "W4"; w4
PRINT #1, "W1 worm"; w1
PRINT #1, "W2 lamb"; w2
PRINT #1, "W3 race"; w3
PRINT #1, "W4 moor"; w4
END IF
used(w) = 0
END IF
NEXT
used(r) = 0
END IF
NEXT
used(o) = 0
END IF
NEXT
used(m) = 0
END IF
NEXT
used(l) = 0
END IF
NEXT
used(e) = 0
END IF
NEXT
used(c) = 0
END IF
NEXT
used(b) = 0
END IF
NEXT
used(a) = 0
END IF
NEXT
Edited on December 21, 2013, 5:52 am
|
Posted by brianjn
on 2013-02-17 06:41:52 |