Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void fill(int *v, char **map, int nr_of_lines, int i, int j, int *count) {
- // check if we landed on a correct spot, return otherwise
- if (i < 0 || j < 0 || i >= nr_of_lines || j >= v[i] * 4 || map[i][j] != 0)
- return;
- // mark the spot and go again in each direction
- map[i][j] = 0x01;
- (*count)++;
- fill(v, map, nr_of_lines, i + 1, j, count);
- fill(v, map, nr_of_lines, i, j + 1, count);
- fill(v, map, nr_of_lines, i - 1, j, count);
- fill(v, map, nr_of_lines, i, j - 1, count);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement