From 943bfb9754b981389899919f189e280ed3d44ff9 Mon Sep 17 00:00:00 2001 From: vehme003 Date: Sun, 11 Apr 2021 23:27:22 -0500 Subject: Update board2.py --- board2.py | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'board2.py') diff --git a/board2.py b/board2.py index 88dfc77..18df6e3 100644 --- a/board2.py +++ b/board2.py @@ -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 + -- cgit v1.2.3