Comment on How long do you think until AI writes and debugs code better than the average programmer?
themusicman@lemmy.world 1 year agoHuh that’s a neat problem. My instinct was to use a (fire, regular) tuple for cost, but then what A* heuristic can you use…
I guess run it once with no cost for regular tiles and remove fire from any tiles it used. Then run with normal tile costs, but block fire tiles. That doesn’t break ties nicely of course and I’m not convinced the first pass has a good A* heuristic either…
ezchili@iusearchlinux.fyi 1 year ago
It works
I think the best option is to make sure to have ‘sorted’ the calls to the fire tiles, you can do that by having them in a separate grid or just stash them to a small local array on stack when you encounter them, and investigate those at the end of the loop
If there’s no result that’s been found under the cost limit without the fire at each point of the algorithm, you do do the recursive calls for the fire
Then once you’re back to the top level call, if there was a non-fire path you will get that result, if there wasn’t you will get that instead