aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvehme003 <vehme003@umn.edu>2021-04-11 23:27:22 -0500
committerGitHub Enterprise <noreply-github@umn.edu>2021-04-11 23:27:22 -0500
commit943bfb9754b981389899919f189e280ed3d44ff9 (patch)
tree1e946349f4756dc3eacdd2e30cf92313b4776df8
parentUpdate main2.py (diff)
downloadcsci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar.gz
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar.bz2
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar.lz
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar.xz
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.tar.zst
csci4511w-943bfb9754b981389899919f189e280ed3d44ff9.zip
Update board2.py
Diffstat (limited to '')
-rw-r--r--board2.py22
1 files changed, 18 insertions, 4 deletions
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
+