Exemplo n.º 1
0
def getThreatened(board, isWhite=True):
   threat = []
   if isWhite:
      pieces = Piece.blackPieces()
   else:
      pieces = Piece.whitePieces()

   for p in pieces:
      threat.extend(getHitlistFor(p, board, not isWhite))
   s = set(threat)
   return [Piece.abbreviation(p) for p in s]