Yes, but something even more fundamental: examine the isInside function, what if x = 0 and y = -1? You need to safeguard against values greater than the size of the grid, but also less than the size...
Type: Posts; User: copeg
Yes, but something even more fundamental: examine the isInside function, what if x = 0 and y = -1? You need to safeguard against values greater than the size of the grid, but also less than the size...
You should safeguard against the edges of the grid. For example, if you are at the first cell [0][0]. Then for line 38:
line 38 = if (checkCell(cells,x+j,y-i))
you will end up checking cell...