Re:Can GPT-4 *Actually* Write Code?
by thethirdone on Friday March 17, 2023 @02:35AM
(#35193932)
That algorithm (implemented efficiently) is just A* using a different concept of distance.
The distance specifically would be `fire*episilon + steps if steps < max else inf`
It doesn't work if you just change the distance. Having implemented similar variations of A* I agree with Tyler. You need to change more than distance to get this to work.
Usually you need to change the search space and increase the number of states you go through to get the algorithm to differentiate between things you want and things you don't want to happen in your final result.
Re:Can GPT-4 *Actually* Write Code?
by anonymoushn on Friday March 17, 2023 @07:53AM
(#35195811)
Counterexample:
...XX
SF.FD
...XX
S = start
F = fire
X = wall
D = destination
The cat can to the destination in 6 moves passing through 1 fire. In the fireWillingness=1 pass, the middle tile is reached after passing through fire, so the destination appears unreachable. The proposed algorithm will pass through 2 fires instead of 1.
Re:Can GPT-4 *Actually* Write Code?
by ThreeToZero on Saturday March 18, 2023 @01:07PM
(#35210907)
Haha good counter example. Well played
1. count fire tiles within movement range
2. run A* from src to dst completly avoiding fire
3. if we can reach then that's the solution
4. if we can reach, increase fireWillingness to 1, re-run A*
5. keep increasing fire-willingness until the A* results don't change, or we can now reach the dst.
This works because a low fire path is always better than a high fire path. And increasing fire-tolerance will only shorten the paths from src to dst.