Ethiopian multiplication: Difference between revisions

(Need to follow the task)
Line 3,028:
 
12 tests, 12 assertions, 0 failures, 0 errors</pre>
 
=={{header|Run BASIC}}==
{{incorrect|Run BASIC|Three named functions?}}
<lang runbasic>x = 17
y = 34
 
[loop]
IF (x mod 2) <> 0 THEN
p = p + y
PRINT x;chr$(9);y;" kept"
ELSE
PRINT x;chr$(9);p;" struck"
END IF
x = int(x / 2)
y = y * 2
if x <> 0 then goto [loop]
 
PRINT chr$(9);"==="
PRINT chr$(9); p
END</lang>
<pre>17 34 kept
8 34 struck
4 34 struck
2 34 struck
1 544 kept
===
578</pre>
 
=={{header|Scala}}==
Anonymous user