Guest User

Untitled

a guest
Jan 21st, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.55 KB | None | 0 0
  1.     /* scanning all blocks */
  2.     fprintf(stdout, "\n");
  3.     int block_size = (int)(sqrt(grid_size));
  4.     for(int b = 0; b < (int)grid_size; b++) {
  5.       fprintf(stdout, "\nblock %d: ", b);
  6.      
  7.       for(int k = 0; k < (int)grid_size; k++) {
  8.     int i_grid = (k/block_size) + (b/block_size)*block_size;
  9.     int j_grid = (k % block_size) + (b % block_size)*block_size;
  10.  
  11.     subgrid[k] = &grid[i_grid][j_grid];
  12.    
  13.     char string[MAX_COLORS+1];
  14.     pset2str(string, *(subgrid[k]));
  15.     fprintf(stdout, "(%d,%d) = '%s', ", i_grid, j_grid, string);
  16.       }
  17.     }
Add Comment
Please, Sign In to add comment