Ethiopian multiplication: Difference between revisions

Content added Content deleted
Line 3,030: Line 3,030:


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


Line 3,036: Line 3,036:
IF (x mod 2) <> 0 THEN
IF (x mod 2) <> 0 THEN
p = p + y
p = p + y
PRINT x;chr$(9);y
PRINT x;chr$(9);y;" kept"
ELSE
ELSE
PRINT x;chr$(9);"---"
PRINT x;chr$(9);p;" struck"
END IF
END IF
x = int(x / 2)
x = int(x / 2)
Line 3,047: Line 3,047:
PRINT chr$(9); p
PRINT chr$(9); p
END</lang>
END</lang>
<pre>17 34
<pre>17 34 kept
8 34 struck
8 ---
4 34 struck
4 ---
2 34 struck
2 ---
1 544
1 544 kept
===
===
578</pre>
578</pre>