15 puzzle solver: Difference between revisions
m
Small coding improvements.
m (Small code improvement.) |
m (Small coding improvements.) |
||
Line 6,376:
private static class Puzzle {
public Puzzle(List<Integer> aTiles, List<String> aMoves, int aZeroIndex,
tiles = aTiles;
moves = aMoves;
Line 6,421:
System.out.println();
}
@Override▼
public int hashCode() {▼
int hash = 3;▼
hash = 23 * hash + tiles.hashCode();▼
hash = 23 * hash + zeroIndex;▼
return hash;▼
}▼
@Override
Line 6,436 ⟶ 6,428:
case Object object -> false;
};
▲ }
▲ @Override
▲ public int hashCode() {
▲ int hash = 3;
▲ hash = 23 * hash + tiles.hashCode();
▲ hash = 23 * hash + zeroIndex;
▲ return hash;
}
Line 6,441:
private List<String> moves;
private int zeroIndex;
private
private static final List<Integer> GOAL = List.of( 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 0 );
|