We have 8x8 Chess board like grid (8x8 2D matrix) and we are trying to color every single square/cell. But the rules are interesting;

  • You may start from any square you want and color that square for the beginning.
  • You can continue coloring another square in the grid which is $4$ or $5$ squares away from the square you started and colored from and so on (vertically or horizontally).
  • You cannot color the same square you colored before or come back again on that.

enter image description here

What is the maximum amount of squares you can color with the given rule above?

  • $\begingroup$ Am I right in thinking this is an 8 x 8 x 8 cube? I think that may need to be included in the question if so $\endgroup$
    – AHKieran
    Dec 4, 2018 at 13:49
  • $\begingroup$ @AHKieran this is 8x8 Grid, not a cube. what makes you think like that? Oo $\endgroup$
    – Oray
    Dec 4, 2018 at 13:50
  • $\begingroup$ sorry i meant an 8 x 8 x A cuboid, so the grids are extruded upwards A times? $\endgroup$
    – AHKieran
    Dec 4, 2018 at 13:51
  • $\begingroup$ perhaps some sort of diagram example would be useful? $\endgroup$
    – AHKieran
    Dec 4, 2018 at 13:52
  • $\begingroup$ Oray, you are misusing the word "Grid". Grid refers to the whole array of squares, whereas you seem to be using it to refer to a single square. $\endgroup$ Dec 4, 2018 at 13:52

4 Answers 4


The one-dimensional problem can be solved as follows:


Since we start and end at a central square, we can use the same strategy on the Y-axis and colour one row at a time. In the end we'll have coloured all 64 squares.

Using chessboard coordinates:

e5 a5 f5 b5 g5 c5 h5 d5
d1 h1 c1 g1 b1 f1 a1 e1
e6 a6 f6 b6 g6 c6 h6 d6
d2 h2 c2 g2 b2 f2 a2 e2
e7 a7 f7 b7 g7 c7 h7 d7
d3 h3 c3 g3 b3 f3 a3 e3
e8 a8 f8 b8 g8 c8 h8 d8
d4 h4 c4 g4 b4 f4 a4 e4

  • $\begingroup$ Er... you can't cross squares that have already been colored. $\endgroup$ Dec 4, 2018 at 14:10
  • $\begingroup$ @ExcitedRaichu Yes you can. Oray at first misread your question in the comments, but then corrected himself a minute or so later. $\endgroup$ Dec 4, 2018 at 14:11
  • $\begingroup$ @JaapScherphuis ah, I definitely didn't see the edit, I was busy typing my answer (with no crossing) $\endgroup$ Dec 4, 2018 at 14:12
  • $\begingroup$ @jafe This is a lovely solution. I was trying to go around in 4x4 squares, filling two rows simultaneously, but was always left with two or more unreachable squares. $\endgroup$ Dec 4, 2018 at 14:16
  • $\begingroup$ So the answer is "64". You answer implies that you're gunning for 64, but, I think you should actually say 64. $\endgroup$ Dec 5, 2018 at 4:16

I think I can get:

63 out of 64 squares coloured


You start in one of the centre lines, 4 in from the left, and move left 4, right 5, left 4, right 5 etc until the whole line is filled.
Then you repeat this vertically, starting from the square you last filled in the row, until the whole column is filled.
Repeating this ends up with a cross in middle 2 rows/columns. After this, repeating this line filling method creates a window like shape with the outside squares also filled.
At this point I managed to go around and fill the inner squares, but I could not move from the last one I filled to the the one remaining square so ended on 63.


I can do

17, without even crossing a colored square


using chessboard coordinates, e4 - e8 - a8 - a3 - f3 - f7 - b7 - b2 - g2 - g6 - c6 - c1 - h1 - h5 - d5 - d1


All 64;

order is as follows:









sorry about the formatting


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.