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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable level of difficulty of AI algorithm #389

Merged
merged 2 commits into from
Jan 4, 2023

Conversation

utarwyn
Copy link
Owner

@utarwyn utarwyn commented Dec 18, 2022

Description

A long-awaited feature will be added to the module!
Levels of difficulty of the AI 馃

As I don't know how to properly modify the minimax algorithm to make it less "intelligent", I use a random rate when the AI plays. Given that, sometimes it picks a random empty cell instead of running whole minimax algorithm. I think it's a good starting point to make the bot easier to beat, and I had to move on to a solution I could afford.

This addition will be available for versions 3 and 4 of the module. 馃殌

Changes

  • Add a new option called "aiDifficulty" which can take a level of difficulty as a string.
    Possible values: (Easy, Medium, Hard, Unbeatable - as actual)

  • Set default difficulty to Unbeatable

Related Issues

Resolves #36
Resolves #333

Any feedbacks?

@utarwyn utarwyn added type: enhancement Features and feature requests. status: testing Issues or PRs that need to be tested in order to be resolved. labels Dec 18, 2022
@utarwyn utarwyn added this to the 3.x milestone Dec 18, 2022
@utarwyn utarwyn self-assigned this Dec 18, 2022
@sonarcloud
Copy link

sonarcloud bot commented Jan 4, 2023

Kudos, SonarCloud Quality Gate passed!聽 聽 Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

98.8% 98.8% Coverage
0.0% 0.0% Duplication

@utarwyn utarwyn merged commit a6a6256 into release/3.x Jan 4, 2023
@utarwyn utarwyn deleted the feature-ai-level branch January 4, 2023 21:53
This was linked to issues Jan 4, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: testing Issues or PRs that need to be tested in order to be resolved. type: enhancement Features and feature requests.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

AI Difficulty Options Option to choose how hard the game is
1 participant