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.
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6c667fb3c15a06c01fc6560721e7364ec013f3542705204a6e15cd0177cff144
|
|
| MD5 |
2215ca1a3c2b558910f7f146d744248c
|
|
| BLAKE2b-256 |
f2b4aded1aa7b78af3c3343473f99408ec0085c18a02d1968a9179d09013c32e
|
File details
Details for the file connect_four_ai_demo-0.1.0-py3-none-any.whl.
File metadata
- Download URL: connect_four_ai_demo-0.1.0-py3-none-any.whl
- Upload date:
- Size: 180.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.7.19
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d27a99ec8e9590ddfb80fd477131d85ba579641917d7e8637c938092024c122c
|
|
| MD5 |
eabcf3dc88bc1e90fed27d3c85b6d405
|
|
| BLAKE2b-256 |
fb779a1a46383171dfee7abaf4e931f968ca01186a760aa14ef83ac59d3ff321
|