ConnectX
This is a project extending the solution to the kaggle-connectx problem statement. Here I have made the frontend UI for the same and added some new features.
Install / Use
/learn @sidhantagar/ConnectXREADME
ConnectX
This project in reinforcement learning has been inspired from the game of connect4 and is an extension to the Kaggle project of ConnectX. The game of connect4 consists of a 2D grid of 6 rows and 7 columns. In the game each of the two players take turns dropping a piece of their color in a column of their choice. The objective of the game is to connect 4 in a row horizontally vertically or diagonally. The game ends if either player achieves the objective or the board is full such that the player cannot make a move.
In the project the dimensions of the game board can be varied from 0-20 along each dimension thus creating more diverse and varied strategy profiles.Also we can change the target of the game from connecting 4 in a row to n (between 3-10.) This makes it impossible to use a predetermied stratedy such as one that exists for the conventional 6x7 board size in the connect 4 game. Thus I decided to use a heuristic
The game has 3 different modes of Player vs Player, Player vs AI and AI vs AI.
About the AI agent:
- The algorithm used in the agent is Minimax.
- The Minimax tree is further deepend using Dynamic Programming as the agent uses a 2 step lookahead.
- Useless branches of pruned using alpha-beta pruning in order to save precious computation time.
- For a complete description of the agent, check out my jupyter notebook where I have uploaded a detailed explanation of the same. Or you can also fork the notebook on Kaggle if you want to play aroung with the code for yourself.
About the UI interface:
- The UI interface has been developed in pygame.
How to run the game:
-
Install python(Preferably python3) on your PC.
-
Use pip to install numpy pandas and pygame libraries.
-
Download and extract all the files in this repository.
-
Run Main_Menu.py
P.S: Running the game for the first time may take pygame considerably more time to load the interface.
| | | |
|--|--|--|
|Main Menu |Editing Menu
|Game Modes
|
| | |
|--|--|
|Sample Game play |Game End
|
Related Skills
YC-Killer
2.7kA library of enterprise-grade AI agents designed to democratize artificial intelligence and provide free, open-source alternatives to overvalued Y Combinator startups. If you are excited about democratizing AI access & AI agents, please star ⭐️ this repository and use the link in the readme to join our open source AI research team.
best-practices-researcher
The most comprehensive Claude Code skills registry | Web Search: https://skills-registry-web.vercel.app
groundhog
400Groundhog's primary purpose is to teach people how Cursor and all these other coding agents work under the hood. If you understand how these coding assistants work from first principles, then you can drive these tools harder (or perhaps make your own!).
last30days-skill
19.1kAI agent skill that researches any topic across Reddit, X, YouTube, HN, Polymarket, and the web - then synthesizes a grounded summary
