The program at the bottom of this post solved, or tried to solve, the alphametics for each of the proposed words. A couple of words gave two solutions each:
WIN WAR word
349 308 famine 1 Not the same numbers
107492
308 349 disarm 2 presented in the puzzle.
107492
678 621 darken 3 (for reference below)
421038
652 649 andpax 4
423148
749 705 repair 5
528045
720 713 barren 6
513360
740 768 darken 7
568320
809 867 ripgis 8
701403
941 928 repair 9
873248
The manual part was to make sense of the a - g phrases using one of the above correspondences:
a) 4LL 4920E7 ALL ARMIES (2) DISARM
b) M452T452 MAINTAIN (4) ANDPAX
c) 49 0872940 IN ARMENIA (1) FAMINE
d) 09 476VE3 IN GRAVES (8) RIPGIS
e) 0784134 H2T3 78 162842 KINDRED HATE IN RWANDA (3) DARKEN
f) 21D 8732T842T7 92884O8S AND REPATRIATE WARRIORS(9) REPAIR
g) I0C20631T6D L10D INCINERATED LAND (6) BARREN
The program:
Dim word$, letters0$, digits0$, war, win
Private Sub Form_Load()
Form1.Visible = True
For w = 1 To 9
For a = 0 To 9
If a <> w Then
For r = 0 To 9
If r <> w And r <> a Then
For i = 0 To 9
If i <> w And i <> a And i <> r Then
For n = 0 To 9
If n <> w And n <> a And n <> r And n <> i Then
war = 100 * w + 10 * a + r
win = 100 * w + 10 * i + n
letters0$ = "warwin"
digits0$ = LTrim(Str(war)) + LTrim(Str(win))
word$ = "darken": testIt
word$ = "famine": testIt
word$ = "barren": testIt
word$ = "ripgis": testIt
word$ = "repair": testIt
word$ = "disarm": testIt
word$ = "andpax": testIt
End If
Next n
End If
Next i
End If
Next r
End If
Next a
Next w
End Sub
Sub testIt()
letters$ = letters0
digits$ = digits0
ans$ = LTrim(Str(win * war))
good = 1
For i = 1 To Len(word)
c$ = Mid(word, i, 1)
p = InStr(letters, c$)
If p > 0 Then
If Mid(ans, i, 1) <> Mid(digits, p, 1) Then good = 0: Exit For
Else
digits = digits + Mid(ans, i, 1)
If InStr(digits, Mid(ans, i, 1)) < Len(digits) Then good = 0
End If
Next
If good Then
Text1.Text = Text1.Text & win & " " & war & " " & word & " " & ans & vbCrLf
DoEvents
End If
End Sub
Note to myself: Luckily any repeated letters in the list of words were also letters in WIN or WAR. If this had not been the case, a repeated letter not in WIN or WAR would have caused a failure in matching, as the first occurrence was not appended to the list of letters that had been assigned, and a repetition of the value would have caused a mismatch.
|
Posted by Charlie
on 2020-11-18 14:53:32 |