Solve:
AID*LMB = "an anagram of BEDLAM"
Rem: It's none of (ambled, lambed, balmed, beldam)- it is another word of 6 distinct letters, I standing for the highest digit.
Bonus question: Anything special about the product?
Dim crlf$
Private Sub Form_Load()
Form1.Visible = True
Text1.Text = ""
crlf = Chr$(13) + Chr$(10)
s$ = "0123456789": h$ = s
Do
bedlam$ = Left(s, 6)
good = 1
For i = 1 To 6
If Mid(s, 7, 1) < Mid(s, i, 1) Then good = 0: Exit For
Next
If Mid(s, 8, 1) > Mid(s, 9, 1) Or Mid(s, 9, 1) > Mid(s, 10, 1) Then good = 0
If good Then
aid = 100 * Val(Mid(s, 5, 1)) + 10 * Val(Mid(s, 7, 1)) + Val(Mid(s, 3, 1))
lmb = 100 * Val(Mid(s, 4, 1)) + 10 * Val(Mid(s, 6, 1)) + Val(Mid(s, 1, 1))
If aid > 99 And lmb > 99 Then
If aid * lmb > 99999 Then
prod$ = LTrim(Str(aid * lmb))
For i = 1 To Len(prod)
If InStr(bedlam, Mid(prod, i, 1)) = 0 Then good = 0: Exit For
If InStr(prod, Mid(prod, i, 1)) < i Then good = 0: Exit For
Next
If good Then
Text1.Text = Text1.Text & "bedlami" & crlf
Text1.Text = Text1.Text & bedlam & Mid(s, 7, 1) & " " & aid & " " & lmb & " " & prod & " "
For i = 1 To Len(prod)
ix = InStr(bedlam, Mid(prod, i, 1))
Text1.Text = Text1.Text & Mid("bedlam", ix, 1)
Next
Text1.Text = Text1.Text & crlf & crlf
End If
End If
End If
End If
DoEvents
permute s
Loop Until s = h
Text1.Text = Text1.Text & crlf & " done"
End Sub
Rather than include an isWord coding, I just looked for an English word in the output:
bedlami
0214539 591 430 254130 ealdmb
bedlami
0235419 493 510 251430 elmadb
bedlami
0237158 183 750 137250 adlemb
bedlami
0248379 394 870 342780 ademlb
bedlami
0281769 798 160 127680 leamdb
bedlami
0283619 698 310 216380 emaldb
bedlami
0284519 598 410 245180 elamdb
bedlami
0312849 891 240 213840 ldeamb
bedlami
0324578 582 470 273540 dmealb
bedlami
0348219 294 810 238140 aelmdb
bedlami
0367148 186 740 137640 aeldmb
bedlami
0372519 597 210 125370 mlaedb
bedlami
0415239 291 530 154230 dleamb
bedlami
0432519 593 210 124530 mleadb
bedlami
0583419 498 310 154380 mealdb
bedlami
0614258 281 450 126450 daelmb
bedlami
0623417 472 310 146320 maeldb
bedlami
0736218 283 610 172630 mealdb
bedlami
0816249 291 640 186240 delamb
bedlami
0823519 592 310 183520 meladb
bedlami
0834769 793 460 364780 dmlaeb
bedlami
0837469 493 760 374680 dlameb
bedlami
1234567 573 461 264153 emlbad
bedlami
1246389 394 681 268314 elmabd
bedlami
1263749 796 341 271436 eabmld
bedlami
1543627 674 321 216354 mbaled
bedlami
1568279 296 871 257816 aemlbd
bedlami
1574289 297 481 142857 blamed *** this is a word ***
bedlami
1635428 483 521 251643 mlbead
bedlami
1765248 286 541 154726 blmead
bedlami
1845639 694 531 368514 maelbd
bedlami
1865429 496 521 258416 mleabd
bedlami
2105368 380 562 213560 bealmd
bedlami
2301859 890 152 135280 lembad
bedlami
2365849 896 542 485632 maldeb
bedlami
2367458 486 752 365472 edmalb
bedlami
2416708 781 602 470162 eamdlb
bedlami
2503416 460 312 143520 malebd
bedlami
2503689 690 382 263580 balemd
bedlami
2536478 483 672 324576 dbaeml
bedlami
2605478 480 572 274560 bmaled
bedlami
2806179 190 672 127680 abmled
bedlami
2836159 193 652 125836 abmedl
bedlami
2874619 697 412 287164 bedmal
bedlami
3167289 296 783 231768 abeldm
bedlami
3204517 570 413 235410 ebalmd
bedlami
3402518 580 213 123540 mlbaed
bedlami
3507429 490 723 354270 beamld
bedlami
3526149 192 643 123456 adbmel
bedlami
3542617 674 213 143562 mdbeal
bedlami
3658149 195 843 164385 aembld
bedlami
3726159 192 653 125376 admbel
bedlami
3857109 195 703 137085 ablmed
bedlami
3857209 295 703 207385 amlbed
bedlami
4012569 591 264 156024 damelb
bedlami
4058329 395 824 325480 amdble
bedlami
4287569 598 764 456872 bamdle
bedlami
4367809 896 704 630784 demlab
bedlami
4521789 792 184 145728 lbeadm
bedlami
4578219 297 814 241758 abmdel
bedlami
4612509 591 204 120564 dlmaeb
bedlami
5027438 482 735 354270 mbadle
bedlami
5134269 293 465 136245 edmalb
bedlami
5208479 490 875 428750 aelmbd
bedlami
5401869 890 165 146850 lemabd
bedlami
5637128 183 725 132675 admelb
bedlami
5708319 390 815 317850 amelbd
bedlami
5712468 481 265 127465 dleamb
bedlami
5812639 691 235 162385 dalmeb
bedlami
5834769 793 465 368745 dmealb
bedlami
5837149 193 745 143785 amdleb
bedlami
6183429 498 326 162348 ebmlad
bedlami
6315248 281 546 153426 dlemab
bedlami
6382719 798 216 172368 malebd
bedlami
6547209 294 706 207564 amlebd
bedlami
7253819 895 317 283715 ealbmd
bedlami
8034529 593 428 253804 madbel
bedlami
8237469 493 768 378624 dlbmea
bedlami
8261759 796 158 125768 lemadb
where I've manually marked the line with a real word:
bedlami aid lmb blamed
1574289 297 * 481 = 142857
I don't notice anything special about the product.
|
Posted by Charlie
on 2017-09-29 10:42:53 |