Guest User

Untitled

a guest
Feb 21st, 2018
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. private int manhattanDistancePlusReversalPenalty(PuzzleState goal) {
  2. int distance = manhattanDistance(goal);
  3. for (int i = 0; i <= 7; ++i) {
  4. for (int j = i + 1; j <= 7; ++j) {
  5. if (board[i] == goal.board[j] && board[j] == goal.board[i]) distance += 2;
  6. }
  7. }
  8. return distance;
  9. }
Add Comment
Please, Sign In to add comment