Hex is a strategic board game for two players played on a hexagonal grid. This implementation of the Hex game allows players to enjoy the game in a terminal interface, providing a convenient and accessible way to play Hex directly from your command line.
Here's a quick look at the game in action:
- Play Hex on various board sizes (from 4x4 to 15x15) with no dependencies.
- 2-player support with a simple turn-based system.
- Terminal-based UI for easy play.
- Simple navigation and game controls.
- Visual feedback for winning paths and invalid moves.
- AI support (coming soon).
- Save and load game state.
- Game history and undo moves support.
- Network play support.
For those who prefer not to install from source or do not have Python installed, you can directly download the game's executable for your operating system in the latest release, and you're ready to start playing Hex directly from your command line. No additional installation or setup required!
After downloading, you may need to grant execution permissions to the file before running it (mainly for macOS and Linux). You can do this by running the following commands in your terminal (replace hexterm_1.0.0_mac
with the name of the file you downloaded):
- macOS and Linux:
chmod +x hexterm_1.0.0_mac ./hexterm_1.0.0_mac
Enjoy the game!
To start the game, simply run the following command:
python hexterm.py
- Use the arrow keys to navigate the board.
- Press
Enter
orSpace
to place a piece on the selected cell. - Press
q
to quit the game at any time.
Hexterm is built to have minimal dependencies. Currently the game requires no external libraries, and can be run with Python Python 3.10 or higher.
If you would like to contribute to the development of Hexterm, you can clone the repository and install the required dependencies. We recommend using a virtual environment to manage the dependencies, specifically we make use of Poetry.
- Clone the repository:
git clone https://github.com/BedirT/HexTerm
cd HexTerm
- Install the dev dependencies:
If you don't have Poetry installed, you can install it with the following command:
pip install poetry
Then, install the dependencies:
poetry install
You are ready to start contributing to Hexterm!
Contributions to the Hex game are welcome! Here's how you can contribute:
- Fork the project.
- Create your feature branch (git checkout -b feature/AmazingFeature).
- Commit your changes (git commit -m 'Add some AmazingFeature').
- Make sure to use
black/flake8/isort
for code formatting. Settings are already included in thepyproject.toml
file and.flake8
file. - Push to the branch (git push origin feature/AmazingFeature).
- Open a pull request.
PS: Currently I have no tests included. Hopefully, I will add them some time.
Distributed under the GNU AGPLv3 License. See LICENSE
for more information.
- Hex game - Wikipedia
- Ryan B Hayward, Hex The Full Story