aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorvehme003 <vehme003@umn.edu>2021-04-11 22:56:31 -0500
committerGitHub Enterprise <noreply-github@umn.edu>2021-04-11 22:56:31 -0500
commitc068edf9e5092a32590d614184668f8559c41d78 (patch)
tree509bced0020cf667ca064363ab9002f822f88919
parentAdd files via upload (diff)
downloadcsci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar.gz
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar.bz2
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar.lz
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar.xz
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.tar.zst
csci4511w-c068edf9e5092a32590d614184668f8559c41d78.zip
Update board2.py
Diffstat (limited to '')
-rw-r--r--board2.py40
1 files changed, 37 insertions, 3 deletions
diff --git a/board2.py b/board2.py
index 1672ec8..88dfc77 100644
--- a/board2.py
+++ b/board2.py
@@ -8,6 +8,40 @@ class Board: #A class for managing different situations and states happening in
for j in i:
print(j,end="")
print()
- def play_move(r,c)
- if(r%2==1):
- \ No newline at end of file
+ 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):
+ c=0
+ elif(v1<9):
+ c=2
+ v1=v1-4
+ v2=v2-4
+ elif(v1<13):
+ c=4
+ v1=v1-8
+ v2=v2-8
+ else:
+ c=6
+ v1=v1-12
+ v2=v2-12
+
+ x1=v1+3*(v1-1)
+ x2=v2+3*(v2-1)
+ for i in range (x1,x2-1):
+ self.board[c][i]="-"
+ else:
+ if(v2<9):
+ c=1
+ elif(v2<13):
+ c=3
+ else:
+ c=5
+ if(v2%4==1):
+ self.board[c][0]="|"
+ elif(v2%4==2):
+ self.board[c][4]="|"
+ elif(v2%4==3):
+ self.board[c][8]="|"
+ else:
+ self.board[c][12]="|"
+