Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed [Question] #4

Open
d-motzer opened this issue Jan 24, 2024 · 1 comment
Open

Speed [Question] #4

d-motzer opened this issue Jan 24, 2024 · 1 comment

Comments

@d-motzer
Copy link

Hi @JohnAD,

did you ever get around to finishing the non-recursive version? I'd love to try out the optimization

@JohnAD
Copy link
Owner

JohnAD commented Jan 25, 2024

Sadly, no. And my time is booked solid for the next 4-plus months, perhaps more.

The optimization does make a huge difference for many game scenarios; remembering my time writing games in Python and C#.

Here is the non-recursive algo in Python: https://github.com/Zulko/easyAI/blob/master/easyAI/AI/NonRecursiveNegamax.py

If you end up writing a non-recursive variant in Nim, I'm happy to take a PR and merge it with this repo and add you as a maintainer.

Fair warning though: most algorithms have border and "off-by-one" conditions to watch out for. This algo is almost 100% border conditions. It isn't pretty or flexible. I strongly recommend writing and running a few games with the recursive version to captuer output and compare against the non-recursive version to verify it doesn't go off the rails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants