Advertisement
Guest User

Untitled

a guest
Dec 8th, 2019
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C 0.46 KB | None | 0 0
  1. void bytes_to_blocks(const int cols, const int offset, bool blocks[offset*8][cols], const int rows, bool bytes[rows][8]) {
  2.     int col = -1;
  3.     int paragraph = 0;
  4.     for(int row = 0; row < rows; row++) {
  5.         col++;
  6.         if(col > (cols -1)) {
  7.             paragraph+=8;
  8.             col =0;
  9.         }
  10.         for(int bit_index = 0; bit_index < 8; bit_index++) {
  11.             blocks[bit_index+paragraph][col] = bytes[row][bit_index];
  12.         }
  13.     }
  14. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement