During my vacation in Canada I have devised the following alphametic :
CANADA+TORONTO=VISITOR
How does it relate to 7813067?
938353 1707817 2646170
CANADA TORONTO VISITOR
therefore
7813067
ONTARIO
the province in which Toronto, Canada, is located.
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
st$ = "9876543210": h$ = st
Do
If InStr(st, "0") > 3 Then
c = Val(Mid(st, 1, 1))
t = Val(Mid(st, 2, 1))
v = Val(Mid(st, 3, 1))
a = Val(Mid(st, 4, 1))
n = Val(Mid(st, 5, 1))
d = Val(Mid(st, 6, 1))
canada = 100000 * c + 10101 * a + 1000 * n + 10 * d
o = Val(Mid(st, 7, 1))
r = Val(Mid(st, 8, 1))
toronto = 1000010 * t + 101001 * o + 10000 * r + 100 * n
i = Val(Mid(st, 9, 1))
s = Val(Mid(st, 10, 1))
visitor = 1000000 * v + 101000 * i + 10000 * s + 100 * t + 10 * o + r
If canada + toronto = visitor Then
Text1.Text = Text1.Text & canada & Str(toronto) & Str(visitor)
End If
End If
DoEvents
permute st
Loop Until st = h
Text1.Text = Text1.Text & crlf & " done"
End Sub
|
Posted by Charlie
on 2016-08-10 07:56:26 |