Exactly what I recently posted. The array @logical is what you are looking for. Should be simple to translate into C.
Update: This generates all numbers up to 2**N-1 that have M bits set. Is that what you want? Your spec is unclear.
In reply to Re: Odometer pattern iterator (in C).
by hdb
in thread Odometer pattern iterator (in C). (Updated.)
by BrowserUk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |