

def _coord_to_algebraic(coord):
    x, y = coord
    return chr(x) + chr(y)


def _algebraic_to_coord(algebraic):
    x, y = algebraic[0], algebraic[1]
    return ord(x), ord(y)


def _is_pos_on_board(coord):
    u"""Return True if coordinate is on the board."""
    x, y = coord
    if (97 <= x <= 104) and (49 <= y <= 56):
        return True
    else:
        return False



def _coord_to_algebraic(coord):
    x, y = coord
    return chr(x) + chr(y)


def _algebraic_to_coord(algebraic):
    x, y = algebraic[0], algebraic[1]
    return ord(x), ord(y)


def _is_pos_on_board(coord):
    u"""Return True if coordinate is on the board."""
    x, y = coord
    if (97 <= x <= 104) and (49 <= y <= 56):
        return True
    else:
        return False


class Piece(object):
    """Parent class for chess pieces."""
    def __init__(self, pos):
        """Instantiate a piece at a coordinate position."""
        super(Piece, self).__init__()
        if isinstance(pos, str):
            self.x, self.y = _algebraic_to_coord(pos)
        else:
            self.x, self.y = pos

Add Piece() to serve as the parent class for all chess pieces
Add Piece() to serve as the parent class for all chess pieces

  
  
  def _coord_to_algebraic(coord):
      x, y = coord
      return chr(x) + chr(y)
  
  
  def _algebraic_to_coord(algebraic):
      x, y = algebraic[0], algebraic[1]
      return ord(x), ord(y)
  
  
  def _is_pos_on_board(coord):
      u"""Return True if coordinate is on the board."""
      x, y = coord
      if (97 <= x <= 104) and (49 <= y <= 56):
          return True
      else:
          return False
  
+ 
+ class Piece(object):
+     """Parent class for chess pieces."""
+     def __init__(self, pos):
+         """Instantiate a piece at a coordinate position."""
+         super(Piece, self).__init__()
+         if isinstance(pos, str):
+             self.x, self.y = _algebraic_to_coord(pos)
+         else:
+             self.x, self.y = pos
+ 
Add Piece() to serve as the parent class for all chess pieces
## Code Before:


def _coord_to_algebraic(coord):
    x, y = coord
    return chr(x) + chr(y)


def _algebraic_to_coord(algebraic):
    x, y = algebraic[0], algebraic[1]
    return ord(x), ord(y)


def _is_pos_on_board(coord):
    u"""Return True if coordinate is on the board."""
    x, y = coord
    if (97 <= x <= 104) and (49 <= y <= 56):
        return True
    else:
        return False

## Instruction:
Add Piece() to serve as the parent class for all chess pieces
## Code After:


def _coord_to_algebraic(coord):
    x, y = coord
    return chr(x) + chr(y)


def _algebraic_to_coord(algebraic):
    x, y = algebraic[0], algebraic[1]
    return ord(x), ord(y)


def _is_pos_on_board(coord):
    u"""Return True if coordinate is on the board."""
    x, y = coord
    if (97 <= x <= 104) and (49 <= y <= 56):
        return True
    else:
        return False


class Piece(object):
    """Parent class for chess pieces."""
    def __init__(self, pos):
        """Instantiate a piece at a coordinate position."""
        super(Piece, self).__init__()
        if isinstance(pos, str):
            self.x, self.y = _algebraic_to_coord(pos)
        else:
            self.x, self.y = pos
