Anonymous user
Ethiopian multiplication: Difference between revisions
→{{header|AutoIt}}: added tutor
No edit summary |
(→{{header|AutoIt}}: added tutor) |
||
Line 160:
EndFunc
Func Ethiopian($a, $b, $fTutor = True)
If $fTutor Then _
ConsoleWrite(StringFormat("Ethiopian multiplication of %d by %d...\n", $a, $b))
Local $r = 0
If
If $fTutor Then ConsoleWrite(StringFormat("%d\t%d\tStrike\n", $a, $b))
Else
If $fTutor Then ConsoleWrite(StringFormat("%d\t%d\tKeep\n", $a, $b))
$r += $b
EndIf
Line 169 ⟶ 174:
$b = Double($b)
WEnd
If $fTutor Then ConsoleWrite(StringFormat("Answer = %d", $r) &@LF)
Return $r
EndFunc
;tutor set to true writes to console
Ethiopian(17, 34, True)
</lang>
|