Jump to content

15 puzzle solver: Difference between revisions

(→‎{{header|Scala}}: Use 2.12 compatible, previously was 2.13.2)
Line 4,649:
// Playing with weight of heuristic vs travelled so far. Giving equal weight take too long.
// Heuristic only will converge too fast on a longer than 52 steps solution.
def aStar() = heuristic() * 35 + travelled() * 24
// Find children/neighbour that is not himself.
def children: List[Board] = List(this.up(), this.down(), this.right(), this.left()).flatten
Anonymous user
Cookies help us deliver our services. By using our services, you agree to our use of cookies.