Procedure isEven(x) ProcedureReturn (x & 1) ! 1 EndProcedure Procedure halveValue(x) ProcedureReturn x / 2 EndProcedure Procedure doubleValue(x) ProcedureReturn x << 1 EndProcedure Procedure EthiopianMultiply(x, y) Protected sum Print("Ethiopian multiplication of " + Str(x) + " and " + Str(y) + " ... ") Repeat If Not isEven(x) sum + y EndIf x = halveValue(x) y = doubleValue(y) Until x < 1 PrintN(" equals " + Str(sum)) ProcedureReturn sum EndProcedure If OpenConsole() EthiopianMultiply(17,34) Print(#CRLF$ + #CRLF$ + "Press ENTER to exit") Input() CloseConsole() EndIf