Jump to content

Ethiopian multiplication: Difference between revisions

m
Line 1,486:
 
=={{header|SNOBOL4}}==
Version "as stated in the task description". BOOORING!
<lang snobol4>
define('halve(num)') :(halve_end)
Line 1,508 ⟶ 1,507:
l = halve(l) :s(next)
stop output = s
end</lang>
 
{{incorrect|SNOBOL4|program needs to define three functions to halve double and test odd/even as stated in the task description.}}
<lang snobol4> l = trim(input)
r = trim(input)
s = 0
next s = ne(l,(l / 2) * 2) s + r
r = r * 2
l = ne(1,l) l / 2 :s(next)
stop output = s
end</lang>
 
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.