Skip to content

Instantly share code, notes, and snippets.

@void-hoge
Created June 27, 2017 12:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save void-hoge/3e2a215961b14eadfcce5b5f1e1c7725 to your computer and use it in GitHub Desktop.
Save void-hoge/3e2a215961b14eadfcce5b5f1e1c7725 to your computer and use it in GitHub Desktop.
void Board::set(int coordinate, int c){
for (int i = 0; i < 16; ++i){
cells[i][coordinate] = false;
}
base mask = 0;
int x = coordinate /16, y = coordinate %16, block;
mask |= (xMask << (x*16));
mask |= (yMask << y);
block = (x/4)*4 + y/4;
mask |= (blockMask[block]);
cells[c] &= ~mask;
cells[c][coordinate] = true;
return;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment