Examples · examples/rack
Rack
A score keeper for letter-tile word games: each move typed straight onto Rack's board as it is on the table (a square tapped, the word typed, each letter landing on the next square), scored as it is typed (every word it makes, the bonus squares, a blank, 50 for all seven tiles), in Polish or English tiles, checked when it is played; a past move changed (a word mistyped), the later ones scored again; the first round's order picked on the board; the letters not seen yet, the end with what is left on each rack, and the games played, replayed move by move. In English or Polish, the device's language unless another is picked. Everything is kept on the device, so it runs as a static copy in a browser and as an app on Android and iOS, with no server at all.
What it shows#
- An app with no server: a static copy on the web, phone apps built --no-server
- Signals kept on the device: packages/local, on Browser.ask!
- Two languages with no server: packages/intl and the device's (Browser.languages!)
- A grid of 225 buttons by keyboard and screen reader: arrow keys, one Tab stop, named squares
- Rules in plain Roc: a word laid, checked and scored, a game replayed from its moves
- One page drawn by the browser, Android and iOS (D-160)
Screenshots#
What it's made of#
- Its browser half
- 358.6 KB
- wasm, brotli; 467.6 KB gzip
- Pages and endpoints
- 2 + 0
- route files' pages, and handlers
- Lines of Roc
- 3,128
- its own .roc and .rocx, blank lines left out
- Tests
- 72
- 62 expects, 10 node tests
- Weighs
- 358.6 KB of wasm, brotli (467.6 KB gzip, 1221.3 KB raw)
- Made of
- 2 pages · 0 endpoints · 3,128 lines of Roc · 62 expects · 10 node tests
- Uses
- packages/intl, packages/local
Measured on 2026-11-29 at commit 74eec5b. The wasm is the app's browser half, built with --opt=size; every page also loads start.js, the page's JavaScript, 22.8 KB brotli. All the examples says how they're measured.
Run it#
With the toolchain set up (just setup), start it from its own directory: it builds, serves at http://127.0.0.1:8080 and builds again when you save. Its README says what to look at.
cd examples/rack && ../../bin/rocx devTo build it, check it and run its tests, from the repository's root:
just examples rack
just examples-release rack # as deployed: rocx build, then the tests against a server built --opt=speed