diff --git a/README.md b/README.md index 590e7f1..c416d13 100644 --- a/README.md +++ b/README.md @@ -8,6 +8,11 @@ It comes with **two game modes**: --- +## Usage +After cloning / downloading the source, simply navigate to either the **cli** or **gui** folder, then simply run `python cli_game.py` or `python gui_game.py`. + +Please note that to run the gui version, you must first install pygame, using `pip install pygame`. + ## Features Both game modes include: @@ -45,3 +50,38 @@ Both game modes include: move the cursor to the top cuz it makes more sense, make it point down. +# PyConnect-4 + +**PyConnect-4** is, as the name suggests, a Python implementation of the classic Connect-4 game. +It comes with **two game modes**: + +- **CLI**: Play directly in the terminal. +- **GUI**: Play using a PyGame graphical interface. + +--- + +## Features + +Both game modes include: + +- Player vs Player (on the same device) +- ~~Player vs Player (LAN)~~ *(currently under maintenance)* +- Player vs CPU (uses a strong minimax algorithm) +- Settings system (adjust display mode and CPU strength) + +--- + +## To-Do List + +### Player vs Player (LAN) + +- Take it out of maintenance. +- Remember the last IP you played against: + - Optionally store IP by hostname. + - Keep a file with all previously played hostname–IP pairs to allow connecting using the computers hostname like `t495` instead of `192.168.1.xxx`. +- Prevent more than 2 people from joining a single game (or consider adding a spectator mode). +- Make sure the game ends properly when players leave, instead of freezing or crashing. + +### Player vs CPU + +- Fix priority issues: sometimes the CPU prefers a vertical 3-in-a-row instead of completing a horizontal win. diff --git a/cli/cli_game.py b/cli/cli_game.py index 39677d1..1017239 100644 --- a/cli/cli_game.py +++ b/cli/cli_game.py @@ -360,9 +360,6 @@ def play_vs_computer(): elif inp in ["y", "yellow"]: play_game(cpu_move_provider, local_move_provider) -def cpu_vs_cpu(): - play_game(cpu_move_provider, cpu_move_provider) - # =========================== # | Menu | # =========================== @@ -478,9 +475,8 @@ while True: print("1. Player vs Player (same device)") print("2. Player vs Player (LAN)") print("3. Player vs CPU") - print("4. CPU vs CPU") - print("5. Edit settings") - print("6. Quit") + print("4. Edit settings") + print("5. Quit") choice = input("Choose 1-4: ").strip() if choice == "1": play_local_pvp() @@ -492,10 +488,8 @@ while True: elif choice == "3": play_vs_computer() elif choice == "4": - cpu_vs_cpu() - elif choice == "5": edit_settings() - elif choice == "6": + elif choice == "5": break else: input("Invalid choice. Press ENTER to try again...")