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

Add different levels of difficulty to the connect 4 AI #1275

Open
1 of 2 tasks
n0Oo0Oo0b opened this issue May 13, 2023 · 4 comments
Open
1 of 2 tasks

Add different levels of difficulty to the connect 4 AI #1275

n0Oo0Oo0b opened this issue May 13, 2023 · 4 comments
Labels
status: planning Discussing details type: feature Relating to the functionality of the application.

Comments

@n0Oo0Oo0b
Copy link

Description

Add 3 levels of difficulty to the connect 4 AI for the user to choose from:

  • Easy: the current AI implementation
  • Medium: the AI also attempts to create 'winning corrdinates' (coordinates where placing a counter will result in a win, each player has a different set of winning coordinates which may overlap) and also attempts to prevent the user from creating such coordinates.
  • Hard: the AI will also account for 'parity' (I'm not sure what else to call it) between the winning coordinates; a winning coordinates for player 2 immediately above a winning coordinate for player 1 will be disregarded because it is unlikely for it to have an effect on the result of the game.

Reasoning

The current connect 4 AI is easy to beat for most users due to its simplicity. Adding harder difficulties will make it more challenging (and entertaining) for users who are more experienced with the game.

Proposed Implementation

The current AI class will be turned into a base class, where subclasses (for each difficulty) implement the play method.
The .connect_four ai command will be modified to accept an additional required argument, difficulty, that will determine which AI is used for the game.

Would you like to implement this yourself?

  • I'd like to implement this feature myself
  • Anyone can implement this feature
@n0Oo0Oo0b n0Oo0Oo0b added status: planning Discussing details type: feature Relating to the functionality of the application. labels May 13, 2023
@n0Oo0Oo0b
Copy link
Author

As a side note, I haven't tested any of the harder difficulties yet (they're just based on my experience and how I play the game) so feel free to suggest any other ideas for harder bots!

@ghost
Copy link

ghost commented Jun 5, 2023

I would be willing to take this if it happens to be accepted.

@n0Oo0Oo0b
Copy link
Author

I would be willing to take this if it happens to be accepted.

I already said in the original issue that I would like to implement this myself.

@ghost
Copy link

ghost commented Jun 5, 2023

Oh shoot, my bad 🤦‍♂️
Didn't read correctly, I'm blind.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: planning Discussing details type: feature Relating to the functionality of the application.
Projects
None yet
Development

No branches or pull requests

1 participant