Skip to main content

A Pygame implementation of Connect Four against an AI opponent, using the `connect-four-ai` library.

Project description

Connect Four AI Demo

A Python demo for the connect-four-ai library.

Connect Four GIF

This project uses Pygame to allow you to play against AI players of varying difficulties. For full details about the library used to create this, please see the main GitHub Repository.

Installation and Usage

To play the demo, you first need to install it using pip:

pip install connect-four-ai-demo

Then, you can use the connect-four command to load the game. This command comes with two command-line arguments:

Option Short Flag Description Default Value
--difficulty -d The difficulty of the AI player. Must be one of:
'easy', 'medium', 'hard', 'impossible'
impossible
--player -p Which player to control (1 = red, 2 = yellow) 1

Example Usage

This example loads the game against a medium difficulty opponent, playing as yellow:

connect-four -d medium -p 2

License

This project is licensed under the MIT License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

connect_four_ai_demo-0.1.0.tar.gz (181.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

connect_four_ai_demo-0.1.0-py3-none-any.whl (180.2 kB view details)

Uploaded Python 3

File details

Details for the file connect_four_ai_demo-0.1.0.tar.gz.

File metadata

  • Download URL: connect_four_ai_demo-0.1.0.tar.gz
  • Upload date:
  • Size: 181.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.7.19

File hashes

Hashes for connect_four_ai_demo-0.1.0.tar.gz
Algorithm Hash digest
SHA256 6c667fb3c15a06c01fc6560721e7364ec013f3542705204a6e15cd0177cff144
MD5 2215ca1a3c2b558910f7f146d744248c
BLAKE2b-256 f2b4aded1aa7b78af3c3343473f99408ec0085c18a02d1968a9179d09013c32e

See more details on using hashes here.

File details

Details for the file connect_four_ai_demo-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for connect_four_ai_demo-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d27a99ec8e9590ddfb80fd477131d85ba579641917d7e8637c938092024c122c
MD5 eabcf3dc88bc1e90fed27d3c85b6d405
BLAKE2b-256 fb779a1a46383171dfee7abaf4e931f968ca01186a760aa14ef83ac59d3ff321

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page