I am currently writing a long class for an application I am working on. There is 2 lines of code that are constantly being repeated, however I cannot think of a quicker way to do it!
The lines are:
for (int row = 0; row < 8; row++)
for (int col = 0; col < 8; col++)
// Do Something
For such a simple "double loop" iteration, there must be some way of either reducing the number of times these two lines appear, or making the code simpler.
Can anyone reduce the character count of this?
EDIT:
For more information,
because the code is repeated so often, I either want to reduce the character count or use an alternative to two for-loops.
the code is used as following (for examples):
for (int row = 0; row < 8; row++)
for (int col = 0; col < 8; col++)
setVal();
for (int row = 0; row < 8; row++)
for (int col = 0; col < 8; col++)
getVal();