diff options
-rw-r--r-- | board2.py | 22 |
1 files changed, 18 insertions, 4 deletions
@@ -4,10 +4,10 @@ class Board: #A class for managing different situations and states happening in def __init__(self, board):
self.board=board
def print_board(self):
- for i in self.board:
- for j in i:
- print(j,end="")
- print()
+ for i in self.board:
+ for j in i:
+ print(j,end="")
+ print()
def play_move(self,v1,v2): #v1 and v2 correlate to the first and second vertex that you would draw to on the board vertex 1 is always smaller than vertex 2
if((v2-v1)==1):
if(v1<5):
@@ -44,4 +44,18 @@ class Board: #A class for managing different situations and states happening in self.board[c][8]="|"
else:
self.board[c][12]="|"
+ def check_fill(self):
+ x=0
+ while(x<=4):
+ y=0
+ while(y<=8):
+ if(self.board[x][y+2]=='-' and self.board[x+1][y]=='|' and self.board[x+1][y+4]=='|' and self.board[x+2][y+2]=='-'):
+ if(self.board[x+1][y+2]!='X'):
+ self.board[x+1][y+2]='X'
+
+
+ y=y+4
+ x=x+2
+ return False
+
|