Skip to content

Commit e3508f9

Browse files
authored
Update tic-tac-toe.py
1 parent 9a0d51d commit e3508f9

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tic-tac-toe.py

+10
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
import numpy as np
2+
3+
def create_board():
4+
x = np.zeros((3,3))
5+
return x
6+
7+
8+
board = create_board()
9+
10+
111
def possibilities(board):
212
y = np.where(board == 0 ) #it gives the indices wherever there are zeros in the form of 2 seperate arrays in a tuple. (array([0, 0, 1, 1, 1, 2, 2, 2]), array([1, 2, 0, 1, 2, 0, 1, 2]))
313
y= np.array(y) # convert it into array.

0 commit comments

Comments
 (0)