NORTH*EAST=WEST*SOUTH
Each letter stands for a certain digit -
there is only one solution...
67104*3820=9320*27504
NORTH EAST WEST SOUTH
from
DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr(13) + Chr(10)
' northeaswu
s$ = "1234567890": hld$ = s
Do
If InStr(s, "0") > 1 And Mid(s, 6, 1) <> "0" And Mid(s, 8, 1) <> "0" And Mid(s, 9, 1) <> "0" Then
north = Val(Left(s, 5))
east = Val(Mid(s, 6, 3) + Mid(s, 4, 1))
west = Val(Mid(s, 9, 1) + Mid(s, 6, 1) + Mid(s, 8, 1) + Mid(s, 4, 1))
south = Val(Mid(s, 8, 1) + Mid(s, 2, 1) + Mid(s, 10, 1) + Mid(s, 4, 2))
End If
If north * east = west * south Then Text1.Text = Text1.Text & Str(north) & Str(east) & Str(west) & Str(south) & crlf
DoEvents
permute s
Loop Until s = hld
Text1.Text = Text1.Text & crlf & " done"
DoEvents
End Sub
|
Posted by Charlie
on 2018-06-07 16:43:27 |