Last active
April 29, 2017 03:14
-
-
Save rharriso/55ae58fa4dbab849e6016311690c98fc to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using cellQueue = queue<shared_ptr<SudokuCell>>; | |
class SudokuBoard { | |
cellQueue cells; | |
public: | |
// initialize board | |
SudokuBoard(){/* ... */} | |
// fill the board with valid solution | |
void fillCells(){/* ... */} | |
// take index and return 2d coord | |
coord resolveIndex(int index) { | |
return coord{ | |
index / SIZE, | |
index % SIZE | |
}; | |
} | |
//Take coord and return index | |
int resolvePosition(const coord &position) { | |
return position.i * SIZE + position.j; | |
} | |
// get cell by index | |
shared_ptr<SudokuCell> at(int index) {/* ... */} | |
// get cell by coord | |
shared_ptr<SudokuCell> at(coord position) {/* ... */} | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment