-
Notifications
You must be signed in to change notification settings - Fork 9
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
Ultimate TTT AI #298
Merged
Ultimate TTT AI #298
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add hardware type config Fix or suppress warnings
@dylwhich I stapled three things onto this PR (hope you don't mind):
|
Nice, good idea! Hah, I think I might have hardcoded the Hard CPU to make the move that's most advantageous for Player 2, because it really feels like it's avoiding winning against me when it goes first |
AEFeinstein
approved these changes
Sep 26, 2024
This all looks good to me (and feels good too). You can merge after addressing feedback (if you wanna) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Adds a single-player CPU opponent with 3 difficulties:
Also changes
tttHandleGameInput()
to use a slightly different method, which should prevent any squares from becoming inaccessible and I think maybe it handles a bit more intuitively than the previous one? I recommend playing with it to see. But it pretty much tries to find a close free space before it wraps all the way around by bumping the cursor away from the edge of the board, and it also prioritizes the last intended direction for the secondary cursor direction.Test Instructions
Play against the AIs, see how they feel. See if the cursor behaves reasonably in some funky situations.
Ticket Links
Closes #267
Readiness Checklist
make format
to format the changesmake cppcheck
and checked thatcppcheck_result.txt
has no warnings for the changes/*! \file
comments with Design Philosophy, Usage, and Example sections for new headers.make docs
and checked thatdoxy_warnings.txt
has no warnings for the new code