Roc Solid
Markup in Roc · pages on a native server · components in WebAssembly

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.

SourceREADMEAll the examples

What it shows#

Screenshots#

A game on a phone-sized browser: the scores, the board with three words on it and a fourth being laid, what it scores word by word, and the move's field
A word being laid, in a phone's browser
The same page on Android's emulator, drawn as native views, its data in the app's SharedPreferences
On Android, with no server
The same page on iOS's simulator, drawn as UIKit views, its data in the app's NSUserDefaults
On iOS, with no server

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 dev

To 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