-
-
Notifications
You must be signed in to change notification settings - Fork 47k
Create minmax.py #7409
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
Create minmax.py #7409
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please could you link some relevant documentation regarding minmax, where users can find more information about this algorithm
leaves of game tree is stored in scores[] | ||
height is maximum height of Game tree | ||
""" | ||
from __future__ import annotations |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
from __future__ import annotations |
The code in this repository is aimed at python 3.10
upwards
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is OK to keep this. The code has more of a chance of working correctly if someone runs it on Python 3.9.
backtracking/minmax.py
Outdated
Minimax helps to achieve maximum score in a game by checking all possible moves | ||
depth is current depth in game tree. | ||
|
||
nodeIndex is index of current node in scores[]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nodeIndex is index of current node in scores[]. | |
node_index is index of current node in scores[]. |
for more information, see https://pre-commit.ci
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice!
Describe your change:
Checklist:
Fixes: #{$ISSUE_NO}
.