Binary digits: Difference between revisions

→‎min: define 'bin' as a proper operator
(→‎min: update)
(→‎min: define 'bin' as a proper operator)
Line 3,593:
{{works with|min|0.37.0}}
<syntaxhighlight lang="min">(
symbol bin
(dup 2 <) 'string
(int :i ==> str :s)
(i (dup 2 <) 'string ('odd? ("1") ("0") if swap 1 shr) 'prefix linrec @s)
linrec
) ^bin::
 
(0 1 2 5 50 9000) 'bin map ", " join puts!</syntaxhighlight>
{{out}}
<pre>0, 1, 10, 101, 110010, 10001100101000</pre>
 
=={{header|MiniScript}}==
559

edits