SEND + MORE = MONEY: Difference between revisions

Content added Content deleted
m (→‎{{header|Phix}}: Replaced with a faster version, use pygments)
m (→‎{{header|Phix}}: minor tidy)
Line 877: Line 877:
used[v+1] = true
used[v+1] = true
if solve_rec(uniq,i+1,s+v*multh[chdx]) then
if solve_rec(uniq,i+1,s+v*multh[chdx]) then
setd(chdx,v,mp)
setd(uniq[i],v,mp)
return true
return true
end if
end if
Line 901: Line 901:
if not find(ch,uniq) then
if not find(ch,uniq) then
uniq &= ch
uniq &= ch
setd(ch-'A'+1,-1,mp)
end if
end if
end for
end for
Line 910: Line 909:
for i,ch in puzzle do
for i,ch in puzzle do
if ch>='A' and ch<='Z' then
if ch>='A' and ch<='Z' then
puzzle[i] = getd(ch-'A'+1,mp)+'0'
puzzle[i] = getd(ch,mp)+'0'
end if
end if
end for
end for