Ethiopian multiplication: Difference between revisions

Line 3,030:
 
=={{header|Run BASIC}}==
<lang runbasic>xrunbasicx = 17
y = 34
 
Line 3,036:
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)
Line 3,047:
PRINT chr$(9); p
END</lang>
<pre>17 34 kept
8 34 struck
8 ---
4 34 struck
4 ---
2 34 struck
2 ---
1 544 kept
===
578</pre>
Anonymous user