23 lines
365 B
Text
23 lines
365 B
Text
def printBinary
|
|
"The decimal value " print dup print " should produce an output of " print
|
|
20 int>bit
|
|
len 1 -1 3 tolist
|
|
for
|
|
get not
|
|
if
|
|
-1 del
|
|
else
|
|
exitfor
|
|
endif
|
|
endfor
|
|
|
|
len 1 -1 3 tolist
|
|
for
|
|
get print
|
|
endfor
|
|
nl
|
|
enddef
|
|
|
|
5 printBinary
|
|
50 printBinary
|
|
9000 printBinary
|