def walkable(self, tile): (x, y) = tup(tile) return True if x < w() and x >= 0 and y < h() and y >= 0 and\ self.v.get(num(x, y)) != TileType.WALL and\ self.v.get(num(x, y)) != TileType.ROCK and\ self.v.get(num(x, y)) != TileType.CLL \ else False
def walkable(self, x, y): tile = self.v.get(num(x, y)) return 0 <= x < w() and \ 0 <= y < h() and \ tile != TT.WALL and \ tile != TT.ROCK and \ tile != TT.CLL
def walkable(self, tile): (x, y) = tup(tile) tile_type = self.v.get(tile) return 0 <= x < w() and \ 0 <= y < h() and \ tile_type != TT.WALL and \ tile_type != TT.ROCK and \ tile_type != TT.CLL
def walkable(self, x, y): return ( True if x < w() and x >= 0 and y < h() and y >= 0 and self.v.get(num(x, y)) != TileType.WALL and self.v.get(num(x, y)) != TileType.ROCK and self.v.get(num(x, y)) != TileType.CLL else False )
def above_water(self): above = set() y = self.m.water + 1 if y >= h(): return None for x in range(w()): t = num(x, y) if self.walkable(t): above.add(t) return above
def above_water(self): above = set() y = self.m.water + 1 if y >= h(): return above for x in range(w()): t = num(x, y) if self.walkable(t): above.add(t) return above
def get_all_lambdas(self): list_lambdas = set() for i in range(h() * w()): if self.v.get(i) == TileType.LAMBDA: list_lambdas.add(tup(i)) return list_lambdas
def get_all_lambdas(self): list_lambdas = set() for i in range(h() * w()): if self.v.get(i) == TT.LAMBDA: list_lambdas.add(tup(i)) return list_lambdas