Show HN: Trail – new kind of logic game
Trail: A Novel Logic Puzzle Experience
Hello HN! I'm excited to share Trail, a minimalist logic game I've been developing.
What is Trail?
The objective is straightforward: you must navigate from the starting point to the exit. However, there is a catch—you must traverse every single cell on the grid exactly once.
"The beauty of the game lies in its simplicity; the challenge lies in the execution."
Core Gameplay Mechanics
The game relies on the mathematical concept of a Hamiltonian Path. To succeed, the player must adhere to these rules:
- Start Point: The designated cell where your journey begins.
- End Point: The final destination that must be reached last.
- Grid Constraints: No cell can be visited more than once.
Difficulty Scaling
As the grid dimensions increase, the complexity of the path grows significantly.
| Grid Size | Difficulty | Estimated Solve Time |
|---|---|---|
| 3x3 | Easy | < 1 minute |
| 5x5 | Medium | 2–5 minutes |
| 10x10 | Hard | 10+ minutes |
Technical Implementation
The game is built using TypeScript and rendered via the HTML5 canvas API. To determine if a level is solved, the engine runs a validation check:
function isSolved(path: Node[], grid: Grid): boolean {
// Check if the path length matches total cells and ends at the exit
return path.length === grid.totalCells && path.endsWith(grid.exit);
}
From a computational perspective, finding a Hamiltonian path is generally -complete. The logic ensures that the total number of visited nodes satisfies:
Game Logic Flow
Development Journey
During the alpha phase, I considered adding power-ups and countdown timers, but I ultimately decided to keep it a pure, meditative logic experience.
Current Roadmap:
- Core pathfinding logic
- Procedural level generator
- Global leaderboard integration
- Daily challenge mode
I would love to get your feedback on the UI and whether the difficulty curve feels natural!
You can play it here: https://trail.game