You find each square by knowing it's x and y coordinates, - that is absolutely correct. Using this logic, you MUST have this known.

The rest of what you need you get by simply using your cursor...