MCPcopy Create free account
hub / github.com/asweigart/PythonStdioGames / displayMaze

Function displayMaze

src/gamesbyexample/mazemakerrec.py:23–32  ·  view source on GitHub ↗
(maze, travelerX=None, travelerY=None)

Source from the content-addressed store, hash-verified

21
22
23def displayMaze(maze, travelerX=None, travelerY=None):
24 for y in range(HEIGHT):
25 for x in range(WIDTH):
26 if maze[(x, y)] == WALL:
27 print(BLOCK, end='')
28 elif travelerX == x and travelerY == y:
29 print('@', end='')
30 else:
31 print(maze[(x, y)], end='')
32 print() # Print a newline after printing the row.
33
34
35def saveMaze(maze, filename):

Callers 1

mazemakerrec.pyFile · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected