I tied to simplify the task as much as possible, so I could apply it to my algorithm.
And here is the challenge for mathematicians and programmers:
I need to
This should do the trick
int cols = 3; int rows = (int) Math.pow(2, cols); for (int row = 0; row < rows; row++) System.out.println(String.format("%" + cols + "s", Integer.toBinaryString(row)).replace(' ', '0').replace('1', 'X'));
out:
000 00X 0X0 0XX X00 X0X XX0 XXX