Getting Started
Jump straight into the engine with per-surface quick starts. Each tab installs the binding, spins up a "hello board" example, and links to the deeper docs when you are ready to explore advanced knobs.
- Rust
- Python
- Web
- Unity
- Godot
- Install.
cargo add [email protected] - Bootstrap a game.
src/main.rs
use tiletangle_engine::{GameConfig, GameState};
fn main() -> anyhow::Result<()> {
let cfg: GameConfig = serde_json::from_str(include_str!("../test_data/configs/classic.json"))?;
let mut state = GameState::new(&cfg, 2)?;
for (idx, player) in state.players.iter().enumerate() {
println!("Player {idx} rack: {:?}", player.rack.tiles);
}
println!("Board is {}×{}", state.board.geom.width, state.board.geom.height);
Ok(())
} - Run it.
cargo run - Next steps. Read through the architecture overview and the move generation deep dive for production builds.
- Install.
pip install tiletangle==0.2.0 - Spawn a state.
hello.py
import json
from tiletangle import Game
cfg = {
"tileset": {"tile_kinds": [{"id": "A", "symbol": "A", "score": 1}]},
"rack_size": 7,
"board_layout": {"width": 5, "height": 5},
"ruleset_id": "cross",
"dictionary_id": "en",
"rng_seed": 42,
"tile_counts": {"A": 20},
"free_word_mode": True,
}
game = Game(json.dumps(cfg), players=2)
board = json.loads(game.get_board_json())
print("Board size:", board["width"], "x", board["height"])
3. **Run it.**
```bash
python hello.py
- Next steps. Jump to the Python binding reference or try the top moves demo for an end-to-end CLI helper.
- Install.
npm install @tiletangle/[email protected] - Load the module.
src/main.ts
import init, { new_game, get_board } from '@tiletangle/engine-wasm';
const cfg = await fetch('/configs/classic.json').then(r => r.json());
await init();
const game = new_game(JSON.stringify(cfg), 2);
const board = JSON.parse(get_board(game));
console.log(board.rows); - Bundle/dev server.
npm run dev - Next steps. Explore the Web/WASM API reference and the interactive Playground guide for UI patterns.
- Install. Point Unity's package manager at the repo tag:
Packages/manifest.json
{
"dependencies": {
"com.tiletangle.engine": "https://example.com/TileTangle.git?path=bindings/unity#0.2.0"
}
} - Open the sample. Import the
BoardDemosample from the package and press Play to see drag-and-drop placement, CPU hints, and non-rect adjacency presets. - Wire your scene. Attach
TileTangle.Engineto a behaviour and callNewGame(...),PreviewMoveJson(...), andPlayMove(...)from your UI logic. - Next steps. Follow the Unity integration guide for lifecycle management, async worker threads, and touch controls.
- Install. Copy the addon into your project and enable it:
res://addons/tiletangle/ - Open the example scene. Load
addons/tiletangle/examples/project.godotand runMain.tscnto exercise staged placements, CPU auto-play, and score overlays. - Script your board. Instantiate
WordEnginein GDScript and callnew_game(),preview_move(), andplay_move()from your UI handlers. - Next steps. Dive into the Godot integration docs for export tips and headless smoke tests.
Need a hosted sandbox?
The Playground runs entirely in-browser, exposing live move generation, adjacency switches, and CPU hints. Use it to validate dictionary builds before embedding them into any of the bindings above.
For packaging automation across all surfaces, run ./tools/package_release.py to reproduce the
release-ready artifacts under dist/.