If given an array of arrays creating an n x n map of tiles, is there a way to loop through an algorithm that would highlight tiles which form a diamond shape? (the key problem is not to hardcode it, so it could work for any sized map)
For example: if the map was 5x5 tiles like so:
XXXXX
XXXXX
XXXXX
XXXXX
XXXXX
How could an algorithm highlight a diamond shape like so:
XXOXX
XOOOX
OOOOO
XOOOX
XXOXX