+/* check if the prev row has a block or not */
+bool prev_row_block (Puzzle *p, int r, int c)
+{
+ if (r == 0)
+ return true;
+ if (p->chars[r-1][c] == '#')
+ return true;
+ return false;
+}
+
+/* check if the next row has a block or not */
+bool next_row_block (Puzzle *p, int r, int c)
+{
+ if (r == p->grid_size-1)
+ return true;
+ if (p->chars[r+1][c] == '#')
+ return true;
+ return false;
+}
+
+/* check if the prev col has a block or not */
+bool prev_col_block (Puzzle *p, int r, int c)
+{
+ if (c == 0)
+ return true;
+ if (p->chars[r][c-1] == '#')
+ return true;
+ return false;
+}
+
+/* check if the next col has a block or not */
+bool next_col_block (Puzzle *p, int r, int c)
+{
+ if (c == p->grid_size - 1)
+ return true;
+ if (p->chars[r][c+1] == '#')
+ return true;
+ return false;
+}
+