Skip to content

Commit eb18f76

Browse files
authored
final pepify
1 parent 4bf9c3f commit eb18f76

File tree

1 file changed

+6
-10
lines changed
  • Code-Sleep-Python/tic-tac-toe

1 file changed

+6
-10
lines changed

Code-Sleep-Python/tic-tac-toe/code.py

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ def create_board():
88
x = np.zeros((3, 3))
99
return x
1010

11-
1211
board = create_board()
1312

1413

@@ -30,12 +29,12 @@ def possibilities(board):
3029
# And keep it totally as a list.
3130
return z
3231

32+
3333
def random_place(board, player):
3434
position = random.choice(possibilities(board))
3535
# print (position)
3636
return place(board, player, position)
3737

38-
3938
board = random_place(board, 2)
4039

4140

@@ -48,8 +47,7 @@ def row_win(board, player):
4847
print("False")
4948
else:
5049
print("False")
51-
52-
50+
5351
row_win(board, 1)
5452

5553

@@ -62,8 +60,7 @@ def col_win(board, player):
6260
print("False")
6361
else:
6462
print("False")
65-
66-
63+
6764
col_win(board, 1)
6865

6966

@@ -76,8 +73,7 @@ def diag_win(board, player):
7673
print("True")
7774
else:
7875
print("False")
79-
80-
76+
8177
diag_win(board, 1)
8278

8379

@@ -95,12 +91,12 @@ def evaluate(board):
9591
winner = -1
9692
return winner
9793

98-
9994
evaluate(board)
10095

10196

10297
# play_game()
10398
def play_game():
99+
104100
board = create_board()
105101
if(0 in board):
106102
player = 1
@@ -109,6 +105,7 @@ def play_game():
109105
player = 2
110106
return z
111107

108+
112109
# plot
113110
R = 1000
114111
ty = []
@@ -140,7 +137,6 @@ def play_strategic_game():
140137
break
141138
return winner
142139

143-
144140
play_strategic_game()
145141

146142

0 commit comments

Comments
 (0)