https://github.com/curnext/hexalink
A Windows-native TUI logic puzzle game inspired by Slitherlink. Features a custom character-based GUI framework and a hexagonal backtracking solver. Developed as a C++ course assignment.
https://github.com/curnext/hexalink
course-project cpp hexagonal-grid puzzle-game slitherlink tui
Last synced: 11 days ago
JSON representation
A Windows-native TUI logic puzzle game inspired by Slitherlink. Features a custom character-based GUI framework and a hexagonal backtracking solver. Developed as a C++ course assignment.
- Host: GitHub
- URL: https://github.com/curnext/hexalink
- Owner: curnext
- Created: 2025-12-19T15:39:11.000Z (6 months ago)
- Default Branch: master
- Last Pushed: 2025-12-19T15:48:27.000Z (6 months ago)
- Last Synced: 2025-12-22T06:38:32.103Z (6 months ago)
- Topics: course-project, cpp, hexagonal-grid, puzzle-game, slitherlink, tui
- Language: C++
- Homepage:
- Size: 12.6 MB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# HiveGame
A console-based hexagonal grid puzzle game developed as a C++ course assignment.
## Introduction
HiveGame is a puzzle game that runs in the Windows console, providing an interactive GUI-like experience through character rendering. It captures mouse and keyboard events to allow for dynamic gameplay, level selection, and editing.
### Compatibility Note
> This game is designed specifically for the **Windows console environment**. It relies on the Windows API for console manipulation.
> - **Best experienced in**: Legacy Windows Console (cmd.exe or powershell.exe).
> - **Current Issues**: There are minor compatibility issues with the latest **Windows Terminal** regarding event handling and rendering.
## Gallery
### Game Overview

*Snapshot showing the three main windows: Level Selection, Gameplay, and Editor.*
### Puzzle Book

*The Puzzle Book interface for browsing and selecting challenges.*
## Core Functionalities
The application consists of three primary modules:
1. **PuzzleBook**: A level browser where you can view and launch different puzzle challenges.
2. **HiveBoard**: The main gameplay interface where you solve hexagonal puzzles by toggling cell states to satisfy numerical constraints.
3. **HiveBoardEdit**: A built-in level editor to design and test custom hexagonal maps.
## Controls
The game primarily uses mouse interactions, supplemented by keyboard shortcuts.
### View Manipulation
- **Alt + Left Click + Drag**: Pan the view.
- **Alt + Mouse Wheel**: Zoom in and out.
- **Right Click**: Open the context menu for most components.
### Navigation & Logic
- **PuzzleBook**: Use the mouse wheel to scroll through pages; middle-click to reset view.
- **HiveBoard**:
- `s`: Find the next "strict" solution.
- `p`: Find the next "partial" solution.
- `a`: Show a normal answer.
- `e`: Clear all current lines/states.
- **Editor**: Single-click to add a cell, double-click to remove, and scroll to change a cell's number.
## Code Organization
The codebase is split into three distinct layers:
### 1. `CW/` (Console Window Framework)
A custom-built GUI framework for the Windows console. It handles:
- **Event Loop**: 30ms refresh rate with asynchronous keyboard/mouse event processing.
- **Widget System**: A hierarchical component system (Buttons, Windows, Scrollables) with localized coordinate spaces.
- **Timer**: A task scheduler for periodic operations like UI updates.
### 2. `Hive/` (Core Game Logic)
Contains the mathematical and algorithmic foundation of the game:
- **HID**: A specialized coordinate system for hexagonal elements (Cells, Lines, Nodes).
- **MagicBee**: A backtracking solver designed to find valid solutions for a given hexagonal configuration.
### 3. `HiveGameW/` (Game Implementation)
Integrates the `CW` framework with `Hive` logic to build the actual game windows and user interactions.
---
*Developed by Hanlin Wu (curnext)*