Skip to content

Instantly share code, notes, and snippets.

@goldensunliu
Created March 4, 2018 23:09
Show Gist options
  • Save goldensunliu/af6568d3687b4004b738a0c153ee29eb to your computer and use it in GitHub Desktop.
Save goldensunliu/af6568d3687b4004b738a0c153ee29eb to your computer and use it in GitHub Desktop.
class Game extends Compoent {
...
eraseSelected = () => {
const selectedCell = this.getSelectedCell();
if (!selectedCell) return;
this.fillNumber(false);
}
fillSelectedWithSolution = () => {
const { board, solution } = this.state;
const selectedCell = this.getSelectedCell();
if (!selectedCell) return;
const { x, y } = board.get('selected');
this.fillNumber(solution[x][y]);
}
...
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment