def __init__(self, row, col, sqSize): GRect.__init__(self, sqSize, sqSize) self.setFilled(True) self.setColor("White") self._row = row self._col = col self._link = None self._rank = 0
def __init__(self, row, col, sqSize): GRect.__init__(self, sqSize, sqSize) self.setFilled(True) self.setColor("White") self._row = row self._col = col self._link = None #added rank variable to determine depth of set self._rank = 0
def __init__(self, sq1, sq2, sqSize): """Creates a wall between sq1 and sq2.""" if sq1._row == sq2._row and sq1._col + 1 == sq2._col: GRect.__init__(self, 2, sqSize + 2) elif sq1._row + 1 == sq2._row and sq1._col == sq2._col: GRect.__init__(self, sqSize + 2, 2) else: raise ValueError("Wall does not connect adjacent squares") self._sq1 = sq1 self._sq2 = sq2 self.setFilled(True) self.setColor("LightGray")
def __init__(self, x, y, width, height, color="Black"): GRect.__init__(self, x, y, width, height) self.setFilled(True) self.setColor(color)