MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / playerMove

Function playerMove

Tic_Tac_Toe/tic_tac_toe.py:43–59  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

41 )
42
43def playerMove():
44 run = True
45 while run:
46 move = input("please select a position to enter the X between 1 to 9: ")
47 try:
48 move = int(move)
49 if move > 0 and move < 10:
50 if spaceIsFree(move):
51 run = False
52 insertLetter('X', move)
53 else:
54 print('Sorry, this space is occupied')
55 else:
56 print('please type a number between 1 and 9')
57
58 except:
59 print('Please type a number')
60
61def computerMove():
62 possibleMoves = [ x for x, letter in enumerate(board) if letter == ' ' and x != 0]

Callers 1

GamePlayFunction · 0.85

Calls 2

spaceIsFreeFunction · 0.85
insertLetterFunction · 0.85

Tested by

no test coverage detected