def move_to_corner(move):
  """Take a move ('color', (row,col)).

    where row, col are 0-indexed (from sgfmill)
    Figure out which corner it's in
    Transform it to be in the upper right corner;
    Returns [corners, move]
      corners: A list of the indices of the corners it is in (0-3)
      move: The transformed move
  """

  color, m = move
  if not m:
    return (None, move)
  y, x = m
  corners = []

  if (x >= 9 and y >= 9):
    corners.append(0)
  elif (x >= 9 and y <= 9):
    corners.append(1)
  elif (x <= 9 and y <= 9):
    corners.append(2)
  elif (x <= 9 and y >= 9):
    corners.append(3)

  y -= 9
  x -= 9
  y = abs(y)
  x = abs(x)
  y += 9
  x += 9

  return [corners, (color, (y, x))]