def positions(self):
        """ Generator producing all 2D positions of all squares. """
        for y in range(self.height):
            for x in range(self.length):
                yield x, y
def positions ( self ) : for y in range ( self . height ) : for x in range ( self . length ) : yield x , y
Generator producing all 2D positions of all squares.