def endgame_score_connectfour(board, is_current_player_maximizer) :
    """Given an endgame board, returns 1000 if the maximizer has won,
    -1000 if the minimizer has won, or 0 in case of a tie."""
    chains_1 = board.get_all_chains(current_player=is_current_player_maximizer)
    chains_2 = board.get_all_chains(current_player= not(is_current_player_maximizer))
    for chain in chains_1:
        if len(chain) == 4:
            return 1000
    for chain in chains_2:
        if len(chain) == 4:
            return -1000
    return 0