The error:
Grid 0, index out of bounds writing [-1,0] - size is [4,4]
Now this implies that I am trying to write to a grid in a position that doesn't exist. I used the debugger and set many break points, going one step at a time until I found the culprit.
// Left side
if (bx-1...