usage in readme, removed cpu vs cpu
This commit is contained in:
parent
ce998b45e4
commit
8ff578b7e9
40
README.md
40
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
|
## Features
|
||||||
|
|
||||||
Both game modes include:
|
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.
|
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.
|
||||||
|
|
|
||||||
|
|
@ -360,9 +360,6 @@ def play_vs_computer():
|
||||||
elif inp in ["y", "yellow"]:
|
elif inp in ["y", "yellow"]:
|
||||||
play_game(cpu_move_provider, local_move_provider)
|
play_game(cpu_move_provider, local_move_provider)
|
||||||
|
|
||||||
def cpu_vs_cpu():
|
|
||||||
play_game(cpu_move_provider, cpu_move_provider)
|
|
||||||
|
|
||||||
# ===========================
|
# ===========================
|
||||||
# | Menu |
|
# | Menu |
|
||||||
# ===========================
|
# ===========================
|
||||||
|
|
@ -478,9 +475,8 @@ while True:
|
||||||
print("1. Player vs Player (same device)")
|
print("1. Player vs Player (same device)")
|
||||||
print("2. Player vs Player (LAN)")
|
print("2. Player vs Player (LAN)")
|
||||||
print("3. Player vs CPU")
|
print("3. Player vs CPU")
|
||||||
print("4. CPU vs CPU")
|
print("4. Edit settings")
|
||||||
print("5. Edit settings")
|
print("5. Quit")
|
||||||
print("6. Quit")
|
|
||||||
choice = input("Choose 1-4: ").strip()
|
choice = input("Choose 1-4: ").strip()
|
||||||
if choice == "1":
|
if choice == "1":
|
||||||
play_local_pvp()
|
play_local_pvp()
|
||||||
|
|
@ -492,10 +488,8 @@ while True:
|
||||||
elif choice == "3":
|
elif choice == "3":
|
||||||
play_vs_computer()
|
play_vs_computer()
|
||||||
elif choice == "4":
|
elif choice == "4":
|
||||||
cpu_vs_cpu()
|
|
||||||
elif choice == "5":
|
|
||||||
edit_settings()
|
edit_settings()
|
||||||
elif choice == "6":
|
elif choice == "5":
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
input("Invalid choice. Press ENTER to try again...")
|
input("Invalid choice. Press ENTER to try again...")
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user