puzzling puzzle

Blitz3D Forums/Blitz3D Programming/puzzling puzzle

Something like this might work. Typed straight into replybox (untested).
For Row = 0 to 9
  For Col = 0 to 6
    c = grid(row,col)
    If (grid(row,col+1) = c) And (grid(row,col+2) = c) And (grid(row,col+3) = c)
      DeleteRow(row,col,c)
      col = 7
    EndIf
  Next
Next

Function DeleteRow(row,col,c)
  For N = col to 9
    If grid(row,n) = c
      grid(row,n) = 0
    Else
      N = 10
    Endif
  Next
  ;If the blocks above this row will fall to fill the empty spaces, add that code here.
End Function