Ethiopian multiplication: Difference between revisions

Line 1,989:
(r r (double r)))
((zerop l) product))))</syntaxhighlight>
 
=={{header|Craft Basic}}==
<syntaxhighlight lang="basic">let x = 17
let y = 34
let s = 0
 
do
 
if x >= 1 then
 
if s = 1 then
 
print x
 
endif
 
if s = 0 then
 
let s = 1
 
endif
 
let a = x
 
let e = a % 2
let e = 1 - e
 
if e = 0 then
 
let t = t + y
print x, " ", y
 
endif
 
let a = x
let a = int: a / 2
let x = a
let a = y
let a = 2 * a
let y = a
 
endif
 
loop x >= 1
 
print "="
print t
 
end
</syntaxhighlight>
 
=={{header|D}}==
305

edits