Hi hi hi
I'm looking for the best way to create a sequence of numbers based on a binary count. I basicaly want to create the sequence of bit activations so I want to return an array of arrays (2d I guess but hardly important) with the numbers like so:
These array represent the bits that are on in the binary representation of a number.
I guess I should say that this is *not* coursework, I am not a student - I work as a web developer.
That's why I need help with the compwikaytud stuff
I can do this with a whole slew of loops but there has to be a more efficient way. Any idea?
--> Josh
Yet another unchecked rambling brought to you by:
Oddball
I'm looking for the best way to create a sequence of numbers based on a binary count. I basicaly want to create the sequence of bit activations so I want to return an array of arrays (2d I guess but hardly important) with the numbers like so:
Code:
{},
{0},
{1},
{0,1},
{2},
{0,2},
{0,1,2},
{3},
{0,3},
{1,3},
{0,1,3},
{2,3},
{0,2,3},
....
These array represent the bits that are on in the binary representation of a number.
I guess I should say that this is *not* coursework, I am not a student - I work as a web developer.
That's why I need help with the compwikaytud stuff
I can do this with a whole slew of loops but there has to be a more efficient way. Any idea?
--> Josh
Yet another unchecked rambling brought to you by:
Oddball