I am trying to create a stream of numbers through a 2d array kind of like a queue but over 2 dimensions.
The final function will take std::string.
I have written some pretty horrific code.. eventually. I looked for a pattern but the thing that gets me is each time the number moves down the queue it needs another line of code and it has to move into the next element in the array.
I figure once I can do that I can put it in a loop.
so you basically add another line of code each time it adds a new number from the iterator.
intarray[0][0] = *it;
++it;
intarray[0][1] = intarray[0][0];
intarray[0][0] = *it;
++it;
intarray[0][2] = intarray[0][1];
intarray[0][1] = intarray[0][0];
intarray[0][0] = *it;
++it;
intarray[0][3] = intarray[0][2];
intarray[0][2] = intarray[0][1];
intarray[0][1] = intarray[0][0];
intarray[0][0] = *it;
++it;
intarray[0][4] = intarray[0][3];
intarray[0][3] = intarray[0][2];
intarray[0][2] = intarray[0][1];
intarray[0][1] = intarray[0][0];
intarray[0][0] = *it;
++it;
intarray[0][5] = intarray[0][4];
intarray[0][4] = intarray[0][3];
intarray[0][3] = intarray[0][2];
intarray[0][2] = intarray[0][1];
intarray[0][1] = intarray[0][0];
intarray[0][0] = *it;
++it;
intarray[0][6] = intarray[0][5];
intarray[0][5] = intarray[0][4];
intarray[0][4] = intarray[0][3];
intarray[0][3] = intarray[0][2];
intarray[0][2] = intarray[0][1];
intarray[0][1] = intarray[0][0];
the numbers go down each time a new number is added from the iterator