15 puzzle solver: Difference between revisions
Content added Content deleted
(→{{header|Scala}}: Use 2.12 compatible, previously was 2.13.2) |
|||
Line 4,649: | Line 4,649: | ||
// Playing with weight of heuristic vs travelled so far. Giving equal weight take too long. |
// 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. |
// Heuristic only will converge too fast on a longer than 52 steps solution. |
||
def aStar() = heuristic() * |
def aStar() = heuristic() * 5 + travelled() * 4 |
||
// Find children/neighbour that is not himself. |
// Find children/neighbour that is not himself. |
||
def children: List[Board] = List(this.up(), this.down(), this.right(), this.left()).flatten |
def children: List[Board] = List(this.up(), this.down(), this.right(), this.left()).flatten |