Ethiopian multiplication: Difference between revisions

Content added Content deleted
(→‎{{header|Forth}}: Marked incorrect.)
Line 3,029: Line 3,029:
12 tests, 12 assertions, 0 failures, 0 errors</pre>
12 tests, 12 assertions, 0 failures, 0 errors</pre>


=={{header|Run BASIC}}==
<lang runbasic>x = 17
y = 34

[loop]
IF (x mod 2) <> 0 THEN
p = p + y
PRINT x;chr$(9);y
ELSE
PRINT x;chr$(9);"---"
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
8 ---
4 ---
2 ---
1 544
===
578</pre>


=={{header|Scala}}==
=={{header|Scala}}==