(board, current_player)
return False
Returns True iff the player has connected  4 (or more)
    This is much faster if written in C or Cython
Returns True iff the player has connected  4 (or more)
    This is much faster if written in C or Cython
Returns True iff the player has connected 4 ( or more ) This is much faster if written in C or Cython
def find_four(board, current_player):
    """
    Returns True iff the player has connected  4 (or more)
    This is much faster if written in C or Cython
    """
    for pos, direction in POS_DIR:
        streak = 0
        while (0 <= pos[0] <= 5) and (0 <= pos[1] <= 6):
            if board[pos[0], pos[1]] == current_player:
                streak += 1
                if streak == 4:
                    return True
            else:
                streak = 0
            pos = pos + direction
    return False
def find_four ( board , current_player ) : for pos , direction in POS_DIR : streak = 0 while ( 0 <= pos [ 0 ] <= 5 ) and ( 0 <= pos [ 1 ] <= 6 ) : if board [ pos [ 0 ] , pos [ 1 ] ] == current_player : streak += 1 if streak == 4 : return True else : streak = 0 pos = pos + direction return False