in reply to sequence of positions to binary sequence
There has to be an easier way and there is:
#just two lines my @bits= (0) x 15; $bits[$_] = 1 for @pos; #...and print the output print "<@bits>\n";
outputs <0 0 1 0 1 0 1 0 0 1 0 0 0 0 0>.
Best, beth
|
|---|