From 636deddbf15bccb9dd944b46bcd6489ae0c26622 Mon Sep 17 00:00:00 2001 From: tzzzzzzzx <414850847@qq.com> Date: Mon, 3 Oct 2022 10:22:13 +0800 Subject: [PATCH] presaved before 1001 --- SafariChess_Gamev1.0.py | 2 +- SafariChess_backend.py | 8 ++++---- .../SafariChess_backend.cpython-39.pyc | Bin 9482 -> 9598 bytes 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/SafariChess_Gamev1.0.py b/SafariChess_Gamev1.0.py index c8ba5bc..9e962a9 100644 --- a/SafariChess_Gamev1.0.py +++ b/SafariChess_Gamev1.0.py @@ -66,7 +66,7 @@ def listenFromServer(): def startNetworkServices(): global client,server,port,addr,connection client = socket.socket(socket.AF_INET, socket.SOCK_STREAM) - server = '127.0.0.1' + server = '192.168.64.246' port = 50005 addr = (server,port) connection = client.connect(addr) diff --git a/SafariChess_backend.py b/SafariChess_backend.py index e97be5b..007edcc 100644 --- a/SafariChess_backend.py +++ b/SafariChess_backend.py @@ -264,7 +264,7 @@ class GameState: #U&D direction while new_row >= 0: nxt_piece = self.board[new_row][col] - if nxt_piece == '00' and not self.inTrap(new_row,col,enemy_color): + if nxt_piece == '00' and not self.inTrap(new_row,col,enemy_color) and not self.inTrap(new_row,col,'r' if enemy_color == 'b' else 'b'): if not self.inHome(new_row,col,self.color()) and not self.inWater(new_row,col): moves.append(Move((row,col),(new_row,col),self.board)) else: if self.Eliminate(row,col,new_row,col): moves.append(Move((row,col),(new_row,col),self.board)) @@ -273,7 +273,7 @@ class GameState: new_row = row while new_row <= 6: nxt_piece = self.board[new_row][col] - if nxt_piece == '00' and not self.inTrap(new_row,new_col,enemy_color): + if nxt_piece == '00' and not self.inTrap(new_row,new_col,enemy_color) and not self.inTrap(new_row,col,'r' if enemy_color == 'b' else 'b'): if not self.inHome(new_row,col,self.color()) and not self.inWater(new_row,col): moves.append(Move((row,col),(new_row,col),self.board)) else: if self.Eliminate(row,col,new_row,col): moves.append(Move((row,col),(new_row,col),self.board)) @@ -282,7 +282,7 @@ class GameState: #L&R Direction while new_col >= 0: nxt_piece = self.board[row][new_col] - if nxt_piece == '00' and not self.inTrap(row,new_col,enemy_color): + if nxt_piece == '00' and not self.inTrap(row,new_col,enemy_color) and not self.inTrap(new_row,col,'r' if enemy_color == 'b' else 'b'): if not self.inHome(row,new_col,self.color()) and not self.inWater(row,new_col): moves.append(Move((row,col),(row,new_col),self.board)) else: if self.Eliminate(row,col,row,new_col): moves.append(Move((row,col),(row,new_col),self.board)) @@ -291,7 +291,7 @@ class GameState: new_col = col while new_col <= 8: nxt_piece = self.board[row][new_col] - if nxt_piece == '00' and not self.inTrap(row,new_col,enemy_color): + if nxt_piece == '00' and not self.inTrap(row,new_col,enemy_color) and not self.inTrap(new_row,col,'r' if enemy_color == 'b' else 'b'): if not self.inHome(row,new_col,self.color()) and not self.inWater(row,new_col): moves.append(Move((row,col),(row,new_col),self.board)) else: if self.Eliminate(row,col,row,new_col): moves.append(Move((row,col),(row,new_col),self.board)) diff --git a/__pycache__/SafariChess_backend.cpython-39.pyc b/__pycache__/SafariChess_backend.cpython-39.pyc index 457961e480240545dde9c92271ff93e3770c15b6..d226807ce3e50786eab1730c468ea560022d6687 100644 GIT binary patch delta 632 zcmZwDy-LGS6bJB}bCXnJTM$Xpf^ET%O!$Q4nBgufP;8$lGYYX$jASjo8*@>sQ=WntxU#HXgg|DZmv&XvKbRQEGU}g ztEo^rAhd!au%LJ;k+Rh;@<*WzQD_2%8Zvhw*+AV38}HDDq{E_h%1{jzs!ZrfO;$p5 zCqdubgEu;F^r-}0#wX5HXtq{UJk7}o@Mx*6cfkif{trU++k~P^iVyBA6HQ`h#rBMo zbeBL>8_^q96O)YODF%jR1eduLc#^u!SV!*~`QVJD@IVSbgl@C0<|7{jEz3GTi7X&u z3%YTR#*|pT=a#t3gj}5r$49qE_cRHihbU9Dz|cez4ot5B~0pcXAc1+`1T4i1WoR?x4Ywv$EZ<+hS@b8!k}7J6%O z5f8@>ehNQ9r@C}-6yF>z^`HqM`TYXV!~5HL?&NN>*)*e7@9uT4&fjub7k^M!-P+ki zvU`xc%p{gskdmpM-AC~#*$5?`P7D}&~NBk>A*r!(buK=1&W43uSI0uW`Ps?FmNcR z`aq`nS`&(K!i4@fHcbB977OnDSjGR=*Nrg7-q)=#C^W&w_IAJVjKIytDo2_Dj& P#{Vg^{C&SEZ)N@fx^sVf