python-discord/sir-lancebot

Add different levels of difficulty to the connect 4 AI

n0Oo0Oo0b opened this issue · 4 comments

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

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!

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

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.

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