J
jason
is there a way to set up an array of bits of generic size, cycle
through all the possible bit patterns, and detect a sub-pattern within
the bit pattern?
for cycling through possible patterns: i was thinking of just using an
unsigned int that increments for the cycling of bit patterns, but those
only come in prescribed sizes. i was hoping for something more generic,
that would allow for a 10bit pattern, for example.
for the sub-pattern analysis: i was hoping to analyze each bit pattern,
and be able to answer questions like "how many bits are 1 in this
pattern?" and "are there three bits in a row that are 1 in this
pattern?"
i can cludge something together using string manipulation, but that
will be much larger, and i'm guessing much slower, than bit pattern
manipulation. any ideas of what i could use for a bit pattern solution?
thanks,
jason
through all the possible bit patterns, and detect a sub-pattern within
the bit pattern?
for cycling through possible patterns: i was thinking of just using an
unsigned int that increments for the cycling of bit patterns, but those
only come in prescribed sizes. i was hoping for something more generic,
that would allow for a 10bit pattern, for example.
for the sub-pattern analysis: i was hoping to analyze each bit pattern,
and be able to answer questions like "how many bits are 1 in this
pattern?" and "are there three bits in a row that are 1 in this
pattern?"
i can cludge something together using string manipulation, but that
will be much larger, and i'm guessing much slower, than bit pattern
manipulation. any ideas of what i could use for a bit pattern solution?
thanks,
jason