Skip to content

Commit 135a9df

Browse files
author
Christian Bender
committed
added random seed in main()
1 parent 59c7ff4 commit 135a9df

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

TicTacToe.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ def inputPlayerLetter():
2828

2929
def whoGoesFirst():
3030
# Randomly choose the player who goes first.
31-
random.seed()
3231
if random.randint(0, 1) == 0:
3332
return 'computer'
3433
else:
@@ -81,7 +80,6 @@ def getPlayerMove(board):
8180
def chooseRandomMoveFromList(board, movesList):
8281
# Returns a valid move from the passed list on the passed board.
8382
# Returns None if there is no valid move.
84-
random.seed()
8583
possibleMoves = []
8684
for i in movesList:
8785
if isSpaceFree(board, i):
@@ -137,7 +135,7 @@ def isBoardFull(board):
137135

138136
def main():
139137
print('Welcome to Tic Tac Toe!')
140-
138+
random.seed()
141139
while True:
142140
# Reset the board
143141
theBoard = [' '] * 10

0 commit comments

Comments
 (0)