egui-nonogram
A self-contained Nonogram (picross) puzzle game library for egui.
Features
- Pure game logic struct (
NonogramGame) with no egui dependency — usable headlessly or with any renderer - Ready-to-use egui
Widget(NonogramWidget) that renders an interactive board with row/column clues - Two ways to build a puzzle:
NonogramGame::from_grid(supply your own picture) andNonogramGame::random(procedural, seeded) - Monochrome only — cells are filled or empty, clues are plain run-length numbers
- Left-click fills a cell, right-click crosses it out; crossed cells are a player aid only and never need to match the solution
- Click-and-drag paints (or erases) a whole stroke of cells in one gesture
- Solved rows/columns dim and strike through their clue as a solving hint
- Optional read-only progress preview thumbnail beside the board
- Undo/redo history
- No losing state — every action is reversible
Usage
Add the dependency:
[]
= "0.1"
Then use it in your egui app:
use ;
// A curated puzzle from an explicit picture:
let grid = vec!;
let mut game = from_grid;
// Or a procedural puzzle, reproducible via a seed:
let mut game = random;
// Inside your egui update/UI closure:
ui.add;
After each frame you can inspect game.status to check for a win:
use GameStatus;
match game.status
To start over on the same puzzle:
game.reset;
egui version compatibility
| egui-nonogram | egui |
|---|---|
| 0.1 | 0.35 |
License
Licensed under either of MIT or Apache-2.0 at your option.