30 lines
412 B
Text
30 lines
412 B
Text
outP = 0
|
|
x = 17
|
|
y = 34
|
|
|
|
while True
|
|
print x + chr(09);
|
|
if not (isEven(x)) then
|
|
outP += y
|
|
print y
|
|
else
|
|
print
|
|
end if
|
|
if x < 2 then exit while
|
|
x = half(x)
|
|
y = doub(y)
|
|
end while
|
|
print "=" + chr(09); outP
|
|
end
|
|
|
|
function doub (a)
|
|
return a * 2
|
|
end function
|
|
|
|
function half (a)
|
|
return a \ 2
|
|
end function
|
|
|
|
function isEven (a)
|
|
return (a mod 2) - 1
|
|
end function
|