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

Function getNewBoard

src/gamesbyexample/reversegam.py:60–72  ·  view source on GitHub ↗

Return a board data structure with the starting tiles.

()

Source from the content-addressed store, hash-verified

58
59
60def getNewBoard():
61 """Return a board data structure with the starting tiles."""
62 board = {}
63 for x in range(8):
64 for y in range(8):
65 board[(x, y)] = ' '
66
67 # Place the two starting tiles for each player:
68 board[(3, 3)] = 'X'
69 board[(3, 4)] = 'O'
70 board[(4, 3)] = 'O'
71 board[(4, 4)] = 'X'
72 return board
73
74
75def getValidMoves(board, tile):

Callers 1

mainFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected