Пример #1
0
	[1, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 0, 1, 0, 1, 1, 0, 1],
	[1, 0, 0, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1],
	[1, 0, 1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1],
	[1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 2, 0, 1],
	[1, 1, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 1, 0, 1],
	[1, 0, 0, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1],
	[1, 0, 1, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 0, 1],
	[1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1]]

# Creating our objects
labyrinth = DataManager.Lab_Data_Manager(labyrinth)

interface = Interface.Viewer()
interface.config_basic() #setting window size values

da_vinci = Interface.Artist(interface.window, interface.canvas)

mickey = Actioner.Rat(1,1)

while True:

	#Showing the labyrinth
	da_vinci.draw(labyrinth.data)

	#Saving last position as 4, spaces already walked by the rat
	labyrinth.data[mickey.y][mickey.x] = 4

	# Rat chooses it's moviment.
	mickey.walk(labyrinth.get_close_spaces(mickey.position))
	
	# If statement for end game