For today’s Quirk, it’s an attempt to fix the greed issue on the base shot function. I added one simply look ahead step to ensure that the current maximum has at least one option going forward, so that the function doesn’t settle on a tile with no good moves.
It worked, to an extent. As you can see below:
So while it does avoid certain obstacles, it ends up taking too many strokes to do so. Issue is also with the obstacle detection: if the line of a stroke so much as brush through a tree tile, for example, that stroke is completely discarded in favor of something else. I’ll add now a function to analyze the angle between the potential stroke and the center of the hazard, and allow it to pass through if the angle is large enough.
With that in place, in the example above, it could easily reduce 2 strokes off the base shot, making it more acceptable. (This is a Par 4 hole based on distance).
Here’s hoping that the third time is the charm!