13 lines
420 B
Python
13 lines
420 B
Python
import json
|
|
|
|
class Map:
|
|
"""Classe che rappresenta la mappa del labirinto."""
|
|
def __init__(self, maze_file):
|
|
with open(maze_file, 'r') as file:
|
|
self.matrix = json.load(file)
|
|
self.height = len(self.matrix)
|
|
self.width = len(self.matrix[0])
|
|
|
|
def is_wall(self, x, y):
|
|
"""Restituisce True se la cella è un muro, False altrimenti."""
|
|
return self.matrix[y][x] |