This file contains hidden or 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
| From https://www.vultr.com/docs/how-to-compile-nginx-from-source-on-ubuntu-16-04 | |
| ./configure --prefix=/home/myusename/nginx/share/nginx \ | |
| --sbin-path=/home/myusename/bin/nginx \ | |
| --modules-path=/home/myusename/nginx/lib/nginx/modules \ | |
| --conf-path=/home/myusename/nginx/nginx.conf \ | |
| --error-log-path=/home/myusename/nginx/log/nginx/error.log \ | |
| --http-log-path=/home/myusename/nginx/log/nginx/access.log \ | |
| --pid-path=/run/nginx.pid \ | |
| --lock-path=/home/myusename/nginx/lock/nginx.lock \ |
This file contains hidden or 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
| // Place your settings in this file to overwrite the default settings | |
| { | |
| "editor.fontFamily": "Fira Code", | |
| "editor.fontSize": 12, | |
| "editor.fontLigatures": true, | |
| "editor.lineNumbers": "relative", | |
| "workbench.colorTheme": "Tomorrow Night Blue", | |
| "vim.disableAnnoyingNeovimMessage": true, | |
| "editor.tabSize": 2, | |
| "C_Cpp.intelliSenseEngine": "Default" |
This file contains hidden or 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
| { | |
| "version": "0.2.0", | |
| "configurations": [ | |
| { | |
| "name": "Attach", | |
| "type": "node", | |
| "request": "attach", | |
| "port": 5858, | |
| "address": "localhost", | |
| "restart": false, |
This file contains hidden or 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
| available_options = (1..9) | |
| def fillCells: | |
| doFillCells(0) | |
| def doFillCells (index): | |
| cell = board.cells[index] | |
| neighbor_values = cell.neighbors.map((neighbor) => neighbor.values) | |
| remaining_options = available_options \ neighbor_values | |
This file contains hidden or 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
| ---------------------------------- | |
| | 3 6 9 | 1 2 4 | 5 8 7 | | |
| | 7 2 8 | 6 5 9 | 3 1 4 | | |
| | 1 4 5 | 7 3 8 | 2 6 9 | | |
| ---------------------------------- | |
| | 2 9 7 | 3 6 1 | 8 4 5 | | |
| | 5 8 3 | 9 4 2 | 6 7 1 | | |
| | 6 1 4 | 5 8 7 | 9 2 3 | | |
| ---------------------------------- | |
| | 9 7 2 | 8 1 5 | 4 3 6 | |
This file contains hidden or 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
| ---------------------------------- | |
| | 3 6 9 | 1 2 4 | 5 8 7 | | |
| | 7 2 8 | 6 5 9 | 3 1 4 | | |
| | 1 4 5 | 7 3 8 | 2 6 9 | | |
| ---------------------------------- | |
| | 2 9 7 | 3 6 1 | 8 4 5 | | |
| | 5 8 3 | 9 4 2 | 6 7 1 | | |
| | 6 1 4 | 5 8 7 | 9 2 3 | | |
| ---------------------------------- | |
| | 9 7 2 | 8 1 5 | 4 3 6 | |
This file contains hidden or 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 = std::deque<SudokuCell>; | |
| class SudokuBoard { | |
| /* | |
| * fill the board with valid solution | |
| */ | |
| void fillCells() { | |
| auto remaininCells = cellQueue{cells}; | |
| if(!doFillCells(remaininCells)) { |
This file contains hidden or 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
| ---------------------------------- | |
| | 7 9 1 | 6 8 4 | 3 2 5 | | |
| | 4 3 8 | 5 2 7 | 9 1 6 | | |
| | 2 6 5 | 3 1 9 | 8 4 7 | | |
| ---------------------------------- | |
| | 5 4 2 | 7 9 3 | 1 6 8 | | |
| | 6 1 7 | 2 4 8 | 5 | | |
| | | | | | |
| ---------------------------------- | |
| | | | | |
This file contains hidden or 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
| bool fillCells() { | |
| for(auto cell : this->cells()) { | |
| // get first cell and tail | |
| auto cell = remainingCells.front(); | |
| remainingCells.pop_front(); | |
| set<int> neighborValues = {}; |
This file contains hidden or 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
| class SudokuBoard { | |
| void generateAllNeighbors () { | |
| // generate row & col neighbors | |
| for (int n = 0; n < 9; ++n) { | |
| neighbors.insert({n, pos.j}); | |
| neighbors.insert({pos.i, n}); | |
| } | |
| auto iFloor = (pos.i / 3) * THIRD; | |
| auto jFloor = (pos.j / 3) * THIRD; |