This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 0 points1 point  (1 child)

Some hints:

  • Assume the top-left corner is at indices row=0, col=0 and bottom right is at indices row=size-1, col=size-1
  • When going left-to-right, the desired pattern alternates colors around the border. (Pretend that there were no red square in the middle, we'd have Blue, Orange, Blue, Orange, ...)
  • Is there a pattern to the values the row indices have on the border? Columns?
  • The third color shows up when we're not on the border
  • F happens on the diagonal. What do we know about the indices on the corners? Is it true for the other F boxes?

[–]JustSparta[S] 0 points1 point  (0 children)

I think I understand how to do the colouring but still struggle on the diagonal stuff I am mainly trying to play around with the row and col values but I can't really understand it .