IndexError: index 804 is out of bounds for axis 0 with size 800
One of the values being returned by touch.x or touch.y are bigger than the dimensions of the sand array.

You could try adding a try/except block around it and print a useful message - just as an example, as I have no idea what this programme is doing (in the on_touch_down function):

def on_touch_down(self, touch)
...
...
    try:
        sand[int(touch.x), int(touch.y)] = 1
    except IndexError:
        print("Touchdown did not occur within the end-zone! No goal!")