Minimum positive multiple in base 10 using only 0 and 1: Difference between revisions

Content added Content deleted
(→‎{{header|Dc}}: really is Tcl, not Dc; sorry)
m (→‎{{header|Phix}}: clarified inner test)
Line 911: Line 911:
val[x+1] = ten
val[x+1] = ten
for j=1 to NUM do
for j=1 to NUM do
integer k = mod(j-1+ten,n)+1
if pow[j] and pow[j]!=x then -- (j seen, in a prior iteration)
if pow[j] and not pow[k] and pow[j]!=x then
integer k = mod(j-1+ten,n)+1
pow[k]=x
if not pow[k] then
pow[k]=x -- (k was seen in this iteration)
end if
end if
end if
end for
end for