def opIsChecked (self): if self.variant == SUICIDECHESS: return False elif self.variant == ATOMICCHESS: if not self.boards[1-self.color][KING]: return False if self.opchecked == None: kingcord = self.kings[1-self.color] self.opchecked = isAttacked (self, kingcord, self.color, ischecked=True) return self.opchecked
def opIsChecked (self): if self.opchecked == None: kingcord = self.kings[1-self.color] self.opchecked = isAttacked (self, kingcord, self.color) return self.opchecked
def isChecked (self): if self.checked == None: kingcord = self.kings[self.color] self.checked = isAttacked (self, kingcord, 1-self.color) return self.checked
def opIsChecked(self): if self.opchecked == None: kingcord = self.kings[1 - self.color] self.opchecked = isAttacked(self, kingcord, self.color) return self.opchecked
def isChecked(self): if self.checked == None: kingcord = self.kings[self.color] self.checked = isAttacked(self, kingcord, 1 - self.color) return self.checked