GoGame-Core is an open-source implementation of a light-weight Go game engine, built with C++ and designed for educational and collaborative purposes. This project includes essential game components such as players, a board, and a game manager, and is extendable for advanced features like AI integration or SGF file support.
While there are many Go software options available, MyAlphaGo is designed with the following goals in mind:
- Educational Value: Most Go software like GNU Go already has massive code space with an integrated AI engine. This project serves as a resource for learning about Go game mechanics, C++ programming, and software design.
- Modularity: A clean and modular architecture allows for easy experimentation and feature additions.
- Community Collaboration: Encouraging open-source contributions to create a robust and flexible Go engine.
- Customization: Provides developers and enthusiasts the ability to tweak and adapt the software to their needs, whether for research or casual play.
-
Game Mechanics:
- Fully functional Go game engine with rules implementation.
- Board state management, including legal move checking and super-ko rule handling.
-
Configurable Settings:
- Customizable board size, komi, and other game parameters via
config.json
.
- Customizable board size, komi, and other game parameters via
-
Extensibility:
- Modular design makes it easy to integrate AI engines or expand features (e.g., SGF file parsing & editing).
- Operating System: Linux (tested on Ubuntu)
- Language: C++20
- Build System: CMake (version 3.29 or later)
- Dependencies:
- nlohmann/json for configuration file parsing.
-
Clone the repository:
git clone https://github.com/<your-username>/MyAlphaGo.git cd MyAlphaGo
-
Build the project:
mkdir build && cd build cmake .. make
-
Run the executable:
./MyAlphaGo
The game settings are defined in a config.json
file. Below is an example configuration:
{
"Game": {
"BoardSize": 19,
"Komi": 6.5,
"Handicap": 0,
"Rule": "Japanese"
}
}
Place this file in the same directory as the executable.
Run the program and follow the instructions in the terminal to play the game. Players will take turns to place stones on the board until the game ends.
main.cpp
: Entry point of the program.Player.cpp
/Player.h
: Defines the Player class and player actions.Board.cpp
/Board.h
: Manages the game board and rules.Game.cpp
/Game.h
: Handles the game state and flow.Config.cpp
/Config.h
: Loads and manages game configuration.
This project is licensed under the MIT License. See the LICENSE file for details.
Contributions are welcome! Here's how you can help:
- Fork the repository.
- Create a new branch for your feature/bugfix.
- Submit a pull request with a detailed explanation of your changes.
Feel free to open issues for bugs, feature requests, or general questions.
If you have any questions or suggestions, feel free to contact me via GitHub Issues.
Happy coding and enjoy Go!