Ethiopian multiplication: Difference between revisions
Content added Content deleted
m (→{{header|Ruby}}: Use end-less defs) |
(→{{header|GW-BASIC}}: PRINT USING, code formatting, output, "works with".) |
||
Line 941: | Line 941: | ||
==={{header|GW-BASIC}}=== |
==={{header|GW-BASIC}}=== |
||
{{works with|BASICA}} |
|||
<syntaxhighlight lang=" |
<syntaxhighlight lang="gwbasic">10 REM Ethiopian multiplication |
||
⚫ | |||
20 DEF FNE(A) = (A + 1) MOD 2 |
|||
⚫ | |||
⚫ | |||
40 DEF FND(A) = 2 * A |
|||
⚫ | |||
⚫ | |||
60 PRINT X, |
|||
⚫ | |||
⚫ | |||
70 PRINT USING "###### ";X; |
|||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
⚫ | |||
110 PRINT USING "= ######";TOT |
|||
⚫ | |||
{{out}} |
|||
<pre> |
|||
17 34 |
|||
8 |
|||
4 |
|||
2 |
|||
1 544 |
|||
= 578 |
|||
</pre> |
|||
==={{header|Liberty BASIC}}=== |
==={{header|Liberty BASIC}}=== |