A data structure for the grid

Time to think like a computer scientist: algorithms and data structures! First, we need to decide on the main data structure.