As would I if I wasn't trying to learn new things by intentionally trying to avoid simple/easy solutions.
In my approach, I minimized the hit for making a miss by just selecting the nearest unchosen bit. The direction to look for that bit is random. Additionally, if there are none available, it randomly selects an endpoint which is guaranteed to be unchosen. It is guaranteed to finish.
Cheers - L~R
In reply to Re^2: Generating 0 .. N Randomly and Efficiently
by Limbic~Region
in thread Generating 0 .. N Randomly and Efficiently
by Limbic~Region
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |