Changeable words: Difference between revisions

Content added Content deleted
m (→‎{{header|REXX}}: changed some whitespace and comments.)
(→‎{{header|Phix}}: simplified)
Line 288: Line 288:
=={{header|Phix}}==
=={{header|Phix}}==
<lang Phix>function changeable(string a, b)
<lang Phix>function changeable(string a, b)
if length(a)!=length(b) then return false end if
return length(a)=length(b) and sum(sq_ne(a,b))=1
bool diff = false
for i=1 to length(a) do
if a[i]!=b[i] then
if diff then return false end if
diff = true
end if
end for
if not diff then ?9/0 end if
return true
end function
end function