Skip to content

Instantly share code, notes, and snippets.

@h0hmj
Last active October 4, 2018 12:28
Show Gist options
  • Save h0hmj/5596ca1b581e4432842c4dff935cbeda to your computer and use it in GitHub Desktop.
Save h0hmj/5596ca1b581e4432842c4dff935cbeda to your computer and use it in GitHub Desktop.
3d miniproject1 mask
int mask[9][9];
void mask_gen_mag() {
int i, j;
for (i = 0; i < 9; i++) {
for (int j = 0; j < 9; ++j) {
if (j == 0)mask[i][j] = (9 - i) % 9;
else if (j == 3)mask[i][j] = (15 - i) % 9;
else if (j == 6)mask[i][j] = (12 - i) % 9;
else mask[i][j] = (mask[i][j - 1] + 1) % 9;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment