Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* scanning all blocks */
- fprintf(stdout, "\n");
- int block_size = (int)(sqrt(grid_size));
- for(int b = 0; b < (int)grid_size; b++) {
- fprintf(stdout, "\nblock %d: ", b);
- for(int k = 0; k < (int)grid_size; k++) {
- int i_grid = (k/block_size) + (b/block_size)*block_size;
- int j_grid = (k % block_size) + (b % block_size)*block_size;
- subgrid[k] = &grid[i_grid][j_grid];
- char string[MAX_COLORS+1];
- pset2str(string, *(subgrid[k]));
- fprintf(stdout, "(%d,%d) = '%s', ", i_grid, j_grid, string);
- }
- }
Add Comment
Please, Sign In to add comment