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
source ~/.profile | |
export ZSH=/Users/{USER}/.oh-my-zsh | |
ZSH_THEME="robbyrussell" | |
plugins=(git) | |
source $ZSH/oh-my-zsh.sh | |
# autojump | |
[[ -s $(brew --prefix)/etc/profile.d/autojump.sh ]] && . $(brew --prefix)/etc/profile.d/autojump.sh |
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
# attach and detach for node debugger | |
'atom-text-editor': | |
'F4': 'node-debugger:attach' | |
'shift-F4': 'node-debugger:stop' | |
# exec command for vim | |
'atom-text-editor.vim-mode-plus.normal-mode': | |
':': 'vim-mode-plus-ex-mode:open' | |
'!': 'vim-mode-plus-ex-mode:toggle-setting' |
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
alert('yo'); | |
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
struct coord { | |
int i = 0; | |
int j = 0; | |
}; | |
// equality comparison between two coors | |
inline bool operator == (const coord &lhs, const coord &rhs) { | |
return lhs.i == rhs.i && lhs.j == rhs.j; | |
} |
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
---------------------------------- | |
| | 7 | | | |
| | 7 | | | |
| | 7 | | | |
---------------------------------- | |
| 7 7 7 | 6 7 7 | 7 7 7 | | |
| | 7 7 7 | | | |
| | 7 7 7 | | | |
---------------------------------- |
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
class SudokuCell { | |
public: | |
coord pos; | |
set<coord> neighbors{}; | |
int value = 0; | |
// set position and generate neighbors | |
void setPosition(coord pos); | |
private |
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(){/* ... */} |
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
// adjust to deque for pushing back on front | |
using cellQueue = deque<shared_ptr<SudokuCell>>; | |
class SudokuBoard { | |
cellQueue cells; | |
public | |
/* | |
* ..... | |
*/ |
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
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 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 | | |
| | | | | |
---------------------------------- | |
| | | | |