in reply to sequence of positions to binary sequence
To help us help you better, please show what code you've already written and how it fails to achieve your goal. Also, it helps if you describe to us in plain English what approach you try to create the "binary array".
A simple approach to a solution would be to recognize that the "binary array" contains only zeroes except at the places given in @pos. As Perl doesn't conveniently handle infinite lists in most places, you have to find an upper bound for the "binary array" list after which it will only ever contain zeroes, to effectively convert the infinite list into a finite list.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: sequence of positions to binary sequence
by coldy (Scribe) on Apr 16, 2009 at 08:20 UTC | |
by citromatik (Curate) on Apr 16, 2009 at 08:25 UTC | |
by Corion (Patriarch) on Apr 16, 2009 at 08:27 UTC | |
by coldy (Scribe) on Apr 16, 2009 at 09:11 UTC |