|
|
|
@ -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))
|
|
|
|
|