Puzzles Flashcards
1
Q
How to get grid reference from index in an array?
A
Column = (index % GridSize) + 1
Row = GridSize - ( index/GridSize )
2
Q
How can you empty a cell e.g., make a blocked cell a normal cell?
A
Copy the line from GetCell() method !!!
Grid[(GridSize - Row) * GridSize + Column - 1] = new Cell();