RosettaCodeData/Task/Binary-digits/Phixmonti/binary-digits-2.phixmonti

19 lines
390 B
Plaintext

/# Rosetta Code problem: http://rosettacode.org/wiki/Binary_digits
by Galileo, 05/2022 #/
include ..\Utilitys.pmt
def printBinary
0 >ps >ps
( "The decimal value " tps " should produce an output of " ) lprint
ps> 20 int>bit
( len 1 -1 ) for
get dup ps> or if print 1 >ps else drop 0 >ps endif
endfor
nl
enddef
5 printBinary
50 printBinary
9000 printBinary