tianyupu / comp3608ass1

Othello (Reversi) implementation in Python
3 stars 1 forks source link

False Positive for possible moves #1

Closed lisafedorenko closed 12 years ago

lisafedorenko commented 12 years ago

This occurs when it has a neighbour which is the same colour, and another neighbour which is an opposite colour but it can't flank. Maybe write a function: canFlank() for the assertion of valid moves and remove those which don't pass eg. Type your move in the form 'x y' (without quotes): 6 6 This is a 8x8 game of Othello. It's b's turn to move. 01234567 +--------+ | |0 | |1 | WWWW |2 | WWWWB|3 | BWWWB|4 | BWWB|5 | WWW |6 | WWB |7 +--------+ {(7, 6): (False, (3, None), False), (3, 1): (False, (None, 4), (None, None, None, (7, 5))), (6, 2): (False, (None, 7), False), (2, 3): ((None, 7), False, (None, None, None, (6, 7))), (3, 7): ((None, 6), False, (None, (7, 3), None, None)), (4, 1): (False, (None, 5), (None, None, None, (7, 4)))} Type your move in the form 'x y' (without quotes): 7 6 This is a 8x8 game of Othello. It's w's turn to move. 01234567 +--------+ | |0 | |1 | WWWW |2 | WWWWB|3 | BWWWB|4 | BWWB|5 | WWWB|6 | WWB |7 +--------+ {(2, 4): ((None, 6), False, (None, (4, 2), None, None)), (7, 7): ((4, None), False, ((2, 2), None, None, None)), (7, 2): (False, False, (None, None, (5, 4), None)), (3, 5): ((None, 6), (2, None), (None, (5, 3), None, (5, 7)))} Type your move in the form 'x y' (without quotes):