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

Function getNewBoard

src/gamesbyexample/pegsolitaire.py:36–46  ·  view source on GitHub ↗

Return a dictionary representing a board for a new game.

()

Source from the content-addressed store, hash-verified

34
35
36def getNewBoard():
37 """Return a dictionary representing a board for a new game."""
38 board = {}
39 # Set every space on the board to a peg:
40 for space in ALL_SPACES:
41 board[space] = PEG
42
43 # Set the center space to be empty:
44 board['D4'] = EMPTY
45
46 return board
47
48
49def displayBoard(board):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected