ACCORD + BRACE = PROJECT has only the one solution, found by the below program. Any other fitting set of letters would also have the same single solution, as the names of the variables doesn't matter, so long as they are distinct.
DefDbl A-Z
Dim crlf$, used(9)
Private Sub Form_Load()
ChDir "C:\Program Files (x86)\DevStudio\VB\projects\flooble"
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
For a = 1 To 9
If used(a) = 0 Then
used(a) = 1
For b = 1 To 9
If used(b) = 0 Then
used(b) = 1
For p = 1 To 9
If used(p) = 0 Then
used(p) = 1
For c = 0 To 9
If used(c) = 0 Then
used(c) = 1
For o = 0 To 9
If used(o) = 0 Then
used(o) = 1
For r = 0 To 9
If used(r) = 0 Then
used(r) = 1
For d = 0 To 9
If used(d) = 0 Then
used(d) = 1
accord = 100000 * a + 11000 * c + 100 * o + 10 * r + d
For e = 0 To 9
If used(e) = 0 Then
used(e) = 1
brace = 10000 * b + 1000 * r + 100 * a + 10 * c + e
For j = 0 To 9
If used(j) = 0 Then
used(j) = 1
For t = 0 To 9
If used(t) = 0 Then
used(t) = 1
project = 1000000 * p + 100000 * r + 10000 * o + 1000 * j + 100 * e + 10 * c + t
If accord + brace = project Then
Text1.Text = Text1.Text & accord & Str(brace) & Str(project) & crlf
DoEvents
End If
used(t) = 0
End If
Next
used(j) = 0
End If
Next
used(e) = 0
End If
Next
used(d) = 0
End If
Next
used(r) = 0
End If
Next
used(o) = 0
End If
Next
used(c) = 0
End If
Next
used(p) = 0
End If
Next
used(b) = 0
End If
Next
used(a) = 0
End If
Next
End Sub
|
Posted by Charlie
on 2014-06-25 12:56:11 |