def getRandomLegalPosition(self):
    x = random.choice(range(self.width))
    y = random.choice(range(self.height))
    while self.isWall((x, y)):
        x = random.choice(range(self.width))
        y = random.choice(range(self.height))
    return (x, y)
def getRandomLegalPosition(self):
    x = random.choice(range(self.width))
    y = random.choice(range(self.height))
    while self.isWall((x, y)):
        x = random.choice(range(self.width))
        y = random.choice(range(self.height))
    return (x, y)