public static int Evaluate(Node node) { PlayerInfo[] playerStatus = board.playerStatus; int me = player_num; int opponent = (player_num + 1) % 2; int opponent_dist = AStarSearch.FindShortestPathLength(board, opponent); int my_dist = AStarSearch.FindShortestPathLength(board, me); if (opponent_dist == 0) { return(-50); } if (my_dist == 0) { return(+50); } int score = opponent_dist - my_dist + (playerStatus[opponent].wallsLeft - playerStatus[me].wallsLeft); return(score); }
public bool CheckWinnable(int id) { return(AStarSearch.FindShortestPathLength(this, id) != -1); }