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

Function hasWon

src/gamesbyexample/parkingvalet.py:197–204  ·  view source on GitHub ↗

Return True if the 'A' car has reached the right edge.

(board)

Source from the content-addressed store, hash-verified

195
196
197def hasWon(board):
198 """Return True if the 'A' car has reached the right edge."""
199 # The puzzle is solved when the 'A' car reaches the right edge.
200 for y in range(board['height']):
201 if board[(board['width'] - 1, y)] == 'A':
202 return True
203
204 return False
205
206
207def askForPlayerMove(board):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected