X-Git-Url: https://git.ucc.asn.au/?p=progcomp2013.git;a=blobdiff_plain;f=qchess%2Fsrc%2Fpiece.py;h=162e82e68a883c5821459475b186b4e06c653f5c;hp=81fbb5673156969fddfd87a60a10309f960ed853;hb=5287b4f869be70ddae4b59a44c448be33f95ccda;hpb=3decbfd61b59ee2611700e7fa96368e02f643d4d diff --git a/qchess/src/piece.py b/qchess/src/piece.py index 81fbb56..162e82e 100644 --- a/qchess/src/piece.py +++ b/qchess/src/piece.py @@ -19,7 +19,7 @@ class Piece(): self.move_pattern = None self.coverage = None - + self.possible_moves = None def init_from_copy(self, c): @@ -75,7 +75,7 @@ class Piece(): # Collapses the wave function! def select(self): - if self.current_type == "unknown": + if self.current_type == "unknown" or not self.choice in [0,1]: self.choice = random.randint(0,1) if self.types[self.choice][0] == '?': self.types[self.choice] = self.types[self.choice][1:]