Ethiopian multiplication: Difference between revisions
Content added Content deleted
(→{{header|AutoIt}}: added tutor) |
|||
Line 157:
Func IsEven($x)
Return (Mod($x,2) == 0)
EndFunc
;tutor set to true writes to console▼
Func Ethiopian($
If $
ConsoleWrite(StringFormat("Ethiopian multiplication of %d by %d...\n", $
While ($nPlier >= 1)
If Not IsEven($
If $
$nResult += $nPlicand
Else
If $
EndIf
$
$
WEnd
If $
Return $
EndFunc
MsgBox(0, "Ethiopian multiplication of 17 by 34", Ethiopian(17, 34) )
▲;tutor set to true writes to console
</lang>
|