MicroGames
MicroGames is a no_std business-logic layer for tiny games.

It is designed for the part of a game that should not care whether the screen is a terminal, a framebuffer, a GPU window, a serial shell, an embedded display, or a custom OS UI. You plug in input, random numbers, events, and output; the crate keeps the rules, state transitions, scoring, and board queries.
Current game engines:
- Tetris-like falling blocks
- Snake
- Minesweeper
- Bejeweled-style match 3
- Chess move/state logic
Shape
The crate is intentionally small and direct:
#![no_std]- no allocator requirement for the core engines
- fixed-size const-generic boards
- deterministic
RandomSourcetrait - event traits for sounds, score changes, row clears, mine reveals, food spawns, and game-over hooks
- query methods for renderers, terminals, tests, and custom shells
The library does not own your event loop or output target. Your platform drives ticks and inputs, then renders from the game state.
use ;
let mut rng = new;
let mut events = NoopEvents;
let mut game = new;
game.move_left;
game.rotate;
game.soft_drop;
for y in game.hidden_rows..game.height_total
Events And Output
Events are callbacks owned by the integration layer. For Tetris:
use ;
;
That is the main contract of MicroGames: the library decides what happened; your platform decides what it means visually, audibly, or operationally.
CLI Proof
The included CLI example is a small std shim around the same no_std engines
used by older TRUEOS UI demos:
Press 1 for Tetris, 2 for Snake, r to reset the current game, and q to
quit. It is deliberately plain. The interesting part is that the game logic and
renderers do not depend on std, TRUEOS, or a particular terminal backend.
There is also a small smoke example that touches every engine:
Documentation
- API docs: https://docs.rs/microgames
- Crate page: https://crates.io/crates/microgames
Publishing Check
Before publishing: