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

Function getNewPuzzle

src/gamesbyexample/slidingtilepuzzle.py:127–133  ·  view source on GitHub ↗

Get a new puzzle by making random slides from a solved state.

(moves=200)

Source from the content-addressed store, hash-verified

125
126
127def getNewPuzzle(moves=200):
128 """Get a new puzzle by making random slides from a solved state."""
129 board = getNewBoard()
130
131 for i in range(moves):
132 makeRandomMove(board)
133 return board
134
135
136# If this program was run (instead of imported), run the game:

Callers 1

mainFunction · 0.85

Calls 2

makeRandomMoveFunction · 0.85
getNewBoardFunction · 0.70

Tested by

no test coverage detected