Пример #1
0
def human(player, board):
    print othello.print_board(board)
    print 'Your move?'
    while True:
        move = raw_input('> ')
        if move and check(int(move), player, board):
            return int(move)
        elif move:
            print 'Illegal move--try again.'
Пример #2
0
def main():
    try:
        black, white = get_players()
        board, score = othello.play(black, white)
    except othello.IllegalMoveError as e:
        print e
        return
    except EOFError as e:
        print 'Goodbye.'
        return
    print 'Final score:', score
    print '%s wins!' % ('Black' if score > 0 else 'White')
    print othello.print_board(board)