Coding Global Background
Coding Global

Bro ai wins me soooo bad at game "five in a row"

python
Archived 7 months ago
0 messages
1 members
8 months ago
Open in Discord
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. ![image](https://images.feynmanxie.cc/main/%E5%B1%8F%E5%B9%95%E6%88%AA%E5%9B%BE%202025-05-04%20160019.png)