I'm implementing the Chessboard class to represent the chessboard. I've to implement the transformations (reflections and rotations) on the chess board possible.
The possible transformations includes the combination of:
1. Vertical Reflection 2. Horizontal Reflection 3. Diagonal Reflection
Thus, we've 8 possible transformations for chess board.
There are 64 squares on the Chessboard numbered [0..63].
Thus, to represent the total resulting values after the transformations is 8*64 (No.of Transformations * Chessboard_Size).
There are two fundamental ways to represent the transformed_board using Arrays:
One-Dimensional Array with transformed_board[8*64] Two-Dimensional Array with transformed_board
- Which approach is better?
- What are the pros and cons of each approach?
- How will effect the performance with respect to time factor?