Bro ai wins me soooo bad at game "five in a row"
python
Archiviert 7 months ago
B
-_Single_-
Script Kiddie!
Gobang - Five-in-a-Row AI Game
Project Description
Gobang is a Five-in-a-Row (Gomoku) game implemented with Pygame, supporting three modes: Player vs AI, AI vs AI, and Player vs Player. The built-in AI uses various strategies, including an opening book, dynamic evaluation, minimax search with alpha-beta pruning, and more, providing strong gameplay and rich variability.
Tech Stack
Python 3
Pygame (for GUI and interaction)
Algorithms: Minimax search, Alpha-Beta pruning, pattern evaluation, opening book, dynamic situation adjustment
Key Features & Challenges Overcome
Three Game Modes: Player vs AI, AI vs AI, Player vs Player, with flexible switching.
Smart AI:
Uses an opening book in the early game for diversity and practical play.
Dynamic evaluation function considering offense, defense, position, flexibility, and more.
Minimax search with alpha-beta pruning for efficient move calculation.
Pattern recognition and threat detection (live three, live four, double three, VCF/VCT, etc.).
Randomness and weighted selection to avoid repetitive AI moves and enhance playability.
Graphical Interface: Clear and intuitive board, pieces, and status display using Pygame.
User-Friendly Interaction: Mouse click to place pieces, SPACE to restart, real-time turn and win/draw display.
Clean Code Structure: Well-organized modules for easy extension and maintenance.

