-
So this is a classic path-finding problem, for which A* (also known as best-first search) is the standard solution. I know I've written that a few times in the past, but I didn't have a standard library for it just sitting around. I searched my hard drive for file names containing "path" and ".ms", expecting to find a path-finding module I seem to recall writing for Farmtronics. But instead I found this script from a half-written space trader game called Starfarer.
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
So this is a classic path-finding problem, for which A* (also known as best-first search) is the standard solution. I know I've written that a few times in the past, but I didn't have a standard library for it just sitting around. I searched my hard drive for file names containing "path" and ".ms", expecting to find a path-finding module I seem to recall writing for Farmtronics. But instead I found this script from a half-written space trader game called Starfarer.
-
adventofcode
Advent of Code solutions of 2015, 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 and 2024 in Scala (by sim642)
Welcome back to my series of Advent of Code solutions in MiniScript! For day 12, we have to find a path in a varied terrain. From any point on the terrain, you can only step to neighboring points no more than 1 unit higher than your current point.
-
One lesson learned is that I should always validate my function inputs. Had my findPath function simply checked that it was being passed two 2-element lists, I would have caught my error right away and fared much better. Grabbing code from somewhere else is no excuse; the first thing I should have done is examined the parameters, and added a quick qa.assert to me sure I call it correctly.