<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def set_tile(self, row, col, value):
 """ Set the tile at position row, col to have the given value. """
   
        #print('set_tile: y=', row, 'x=', col)
        if col < 0:
            print("ERROR - x less than zero", col)
            col = 0
            #return
            
        if col > self.grid_width - 1 :
            print("ERROR - x larger than grid", col)
            col = self.grid_width - 1
            #return
            
        if row < 0:
            print("ERROR - y less than zero", row)
            row = 0
            #return
            
        if row > self.grid_height - 1:
            print("ERROR - y larger than grid", row)
            row = self.grid_height - 1

        self.grid[row][col] = value