Puzzles Flashcards

1
Q

How to get grid reference from index in an array?

A

Column = (index % GridSize) + 1

Row = GridSize - ( index/GridSize )

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
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();

How well did you know this?
1
Not at all
2
3
4
5
Perfectly