Skip to content

This project was initially developed as an assignment for the TU Berlin Programming Project in Python [WiSe 2024/25]. In this project, Connect4 is implemented using fundamental concepts of "software carpentry".

License

Notifications You must be signed in to change notification settings

akekesi/Connect4

Repository files navigation

Connect4 🔴🟡

Status CI

Python Shell Script

connec4_demo_gif

Table of Contents

  1. Description
  2. Demo
  3. Prerequisites
  4. Python Environment Setup
  5. TicTacToe User Guide
  6. Connect4 User Guide
  7. To-Do
  8. Authors
  9. Acknowledgements
  10. License

Description

🚧 This project is a work in progress. Some features may be incomplete, untested, or lacking full documentation. 🚧

This project was initially developed as an assignment for the TU Berlin Programming Project in Python [WiSe 2024/25]. In this project, Connect4 is implemented using fundamental concepts of "software carpentry", including:

  • Use of a version control system, such as Git
  • Test-driven development
  • Documentation
  • Debugging, profiling, and optimization
  • (Optional) Issue tracking and milestones for project planning
  • (Optional) Software design and associated artifacts, e.g., activity/class diagrams

Demo

connect4_demo_gif

Prerequisites

Python Environment Setup

1. Installing Python Packages

  • With a Virtual Environment (using a shell script):
$ . venv_setup.sh <arg1> <arg2>
  • <arg1>: Suffix for naming the virtual environment (optioanla).
  • <arg2>: Set to "dev" to include requirements_dev.txt (optioanla)
    Examples:
$ . venv_setup.sh               # Creates .venv_connect4
$ . venv_setup.sh test          # Creates .venv_connect4_test
$ . venv_setup.sh "" dev        # Creates .venv_connect4_dev
$ . venv_setup.sh test dev      # Creates .venv_connect4_test_dev
  • Without a Virtual Environment:
$ python -m pip install --upgrade pip
$ pip install -r requirements.txt
$ pip install -r requirements_dev.txt

2. Running TikTakToe

TikTacToe demonstrates the use of minimax in a simplified setting, offering a practical example of how the algorithm can be applied to solve game-based problems.

$ python -m src.ticktackoe

3. Running Connect4

$ python -m src.connect4

4. Running Pylint (with requirements_dev.txt)

$ pylint src/<name_of_file>

5. Running a Single Unit Test (with requirements_dev.txt)

$ python -m tests.<name_of_test_file>

6. Running All Unit Tests (with requirements_dev.txt)

$ python -m unittest discover tests

7. Running Coverage with Unit Tests (with requirements_dev.txt)

$ coverage run -m unittest discover tests
$ coverage report
$ coverage html

View the HTML coverage report at: htmlcov/index.html

TicTacToe User Guide

1. Rules of TicTacToe

TicTacToe

2. Running TicTacToe

$ python -m src.ticktackoe

Connect4 User Guide

1. Rules of Connect4

Connect4

2. Running Connect4

$ python -m src.connect4

To-Do

Notation

  • Task to do
  • Task in progress
  • Task finished

To-Do

  • Using GitHub Issues insted of this To-Do list 😎
  • Finish User Guide
  • Make unit test for minimax.py
  • MAke unit test for tictactoe.py
  • Add logging
  • Add demo
  • Add version
  • Add setup.py, .toml
  • Add badges (GitHub Actions CI)
  • Add badges (GitHub Actions Coverage)
  • Add badges (Version)
  • Add badges (...)
  • Add demo, animation, or video
  • Complete README.md
  • Update CI.yml (deprecation of v3 of the artifact actions)

Authors

Attila Kékesi

Acknowledgements

License

Code released under the MIT License.

About

This project was initially developed as an assignment for the TU Berlin Programming Project in Python [WiSe 2024/25]. In this project, Connect4 is implemented using fundamental concepts of "software carpentry".

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published