DefDbl A-Z
Dim crlf$
Private Sub Form_Load()
Text1.Text = ""
crlf$ = Chr(13) + Chr(10)
Form1.Visible = True
DoEvents
'itrklmue
a$ = "1234567890": h$ = a$
Do
it = Val(Left(a$, 2))
irk = 100 * (it \ 10) + Val(Mid(a$, 3, 2))
klm = Val(Mid(a$, 4, 3))
truev = 1000 * (it Mod 10) + Val(Mid(a$, 3, 1) + Mid(a$, 7, 2))
If it * irk + klm = truev Then
i = it \ 10
t = it Mod 10
r = (irk \ 10) Mod 10
k = irk Mod 10
l = (klm \ 10) Mod 10
m = klm Mod 10
u = (truev \ 10) Mod 10
e = truev Mod 10
good = 1: w$ = ""
For j = 1 To 4
dig = Val(Mid("7844", j, 1))
didone = 0
If i = dig Then w$ = w$ & "i": didone = 1
If t = dig Then w$ = w$ & "t": didone = 1
If r = dig Then w$ = w$ & "r": didone = 1
If k = dig Then w$ = w$ & "k": didone = 1
If l = dig Then w$ = w$ & "l": didone = 1
If m = dig Then w$ = w$ & "m": didone = 1
If u = dig Then w$ = w$ & "u": didone = 1
If e = dig Then w$ = w$ & "e": didone = 1
If didone = 0 Then good = 0: Exit For
Next j
If good Then
If Mid(a$, 9, 1) < Right(a$, 1) Then
Text1.Text = Text1.Text & w$ & Str(it) & Str(irk) & Str(klm) & Str(truev) & crlf: DoEvents
End If
End If
End If
permute a$
Loop Until a$ = h$
Text1.Text = Text1.Text & "done"
End Sub
finds
7844 IT*IRK+KLM=TRUE
kull 12 137 745 2389
kemm 12 137 754 2398
lmrr 12 146 678 2430
elrr 12 146 685 2437
mlrr 12 146 687 2439
urll 12 186 643 2875
mlrr 26 241 187 6453
tlkk 27 264 481 7609
tlkk 27 264 485 7613
tekk 27 264 490 7618
tumm 27 265 534 7689
tell 27 265 543 7698
rtmm 28 279 904 8716
rtll 28 279 941 8753
mtll 28 296 647 8935
kemm 12 107 754 2038
I'd say
tumm 27 265 534 7689
leads to the word tummy so that $ = Y.
|
Posted by Charlie
on 2014-06-06 16:54:21 |