1. Read the Stack
Top block is f(x); bottom block is x (its position on the graph paper).
Calcy
How it worksA 54 KB WebGL2 renderer (ic-3d.js) + symbolic CAS (ic-slim.mjs) where plain-text .ic equations compile directly into 3D meshes, combat rules, and WebAudio—with zero image or audio files in gameplay.
ic-3d.js WebGL2 renderer
19+ .ic declarative cartridges
448 CAS values doctested
145 KB shipped graphics layer
Calcy is a pocket calculator with boxing gloves who fights formula stacks on graph paper—where a stack stands is its x.
.ic Teach)
Deciding which operation (d/dx, √, ln, −1) to reach for—and encoding that strategic judgment as a rule while ic-slim.mjs handles the computation.
Traditional drills force manual arithmetic first. Once you intuitively know what a derivative, root, or log does and when to use it, learning the by-hand steps is natural.
Top block is f(x); bottom block is x (its position on the graph paper).
d/dx (front kick), ln (backflip), √ (uppercut), or −1 (jab).
Reduce the stack to 0—or lure it onto a root f(x) = 0 for a free pop.
Dividing by 0 or taking ln of a negative triggers a backlash bomb.
A stack's value is f(x), where x is its spot on the paper. So walking is a math decision, learned by playing:
lure x² − 4 onto x = 2 and it pops on its own; bait 30/x toward the y-axis and it boils over like a bomb;
push ln x left of zero and it turns ghostly. Nobody is asked to calculate anything. The cards are moves:
√ is an uppercut, d/dx a front kick,
ln a backflip kick, −1 a jab.
compiled closure: --
Drag the stack along the paper, or punch it with a card.
Every card here goes to the Instacalc engine the game ships (engine/ic-slim.mjs) through the game's own adapter (engine/ic-engine.js), with the boil-over line at a value of 70 from play.html.
.ic, tiny host.* drivers in JSInspired by VPRI STEPS / Nile / Gezira: every formula, 3D rig, audio patch, art pack, and gameplay rule lives in declarative .ic cartridges.
JavaScript is a compact driver kernel (engine/ic-host.js: ZFRules + host.{rules,gl,audio,ui,save,font,zf,loop,cartridge}), the CAS adapter (engine/ic-engine.js + engine/ic-slim.mjs), and the custom WebGL2 renderer (/vendor/ic-3d/ic-3d.js).
Zero duplicated data tables. Views, cameras, style packs, SFX patches, and 3D boss/enemy specs load directly from .ic via host.rules.loadSheet().
VPRI ceiling (~85–90% in .ic). Roughly 25% of shipped gzip bytes are pure .ic text (the rest is the WebGL2/CAS compiler kernel & fonts); over 85% of game & asset definitions are .ic source.
Zero binary assets. Every 3D mesh, canvas decal, graph texture, and synth patch is generated from source code at load.
Analytic functions extrude and lathe directly into Three/ic-3d meshes.
{s: extrude(-0.7, 0.7, 0.7), fn: x => 0.1 * exp(2.75 * (x + 0.7) / 1.4)}One bilateral flag + golden-angle comprehensions replace imperative loops.
{s: sph(0.12 + i*0.024, 10, 8), p: [cos(i*2.4)*r, 0.2+i*0.14, sin(i*2.4)*r]}Rank-polymorphic math and markdown tables collapse config boilerplate.
glove_costs = round(20 * 1.6 ^ (0..<5))
sfx.ic: mtof(n) = 440 * (2 ^ ((n - 69) / 12))2D face textures and multi-oscillator SFX compile from pure records.
coin: {tones: [{f: mtof(88), d: 0.09}, {f: mtof(93), d: 0.16, at: 0.05}]}@example proofs & equation backsolving verify sheets at load. Open .ic Lab
/// @example round(mtof(69)) => 440
/// @example len(enemy_models) => 10A zero-allocation tokenizer (Toki) and Pratt parser (Parsley) turn infix math, APL ranges (0..<5), and .ic rules into a compact AST.
ic-slim.mjs)Runs tree-rewriting rules for simplify, derive, integrate, and solve only when a formula spawns or takes a card hit.
Compiles ASTs to plain JS functions F.f(x) (~25–130 ns/call) and splits terms into clay blocks so 60 fps loops never touch the CAS.
host.* + ic-3d.jsic-host.js binds .ic rules, @example proofs, WebAudio synths, and procedural geometry directly into the WebGL2 renderer.
Calcy and a block stack from the hub's kit (meta/meta-kit.js), built from code and drawn by Instacalc GL, the game's own WebGL2 renderer in /vendor/ic-3d/ic-3d.js.
It keeps three.js's API, so the same scene code runs on either; three.js 0.160 stays only as the test oracle that every frame is compared against.
The numbers are read from the renderer each half second. Drag to turn the desk.
Frame match today (gl/compare.cjs, 2026-11-14): 17 of 17 frames pass against three.js; twelve are the same image, the five boss frames score SSIM 0.9984 to 0.9993. play-test.cjs passes all 178 checks on both renderers.
.ic Assets & CutawaysInstead of shipping multi-megabyte .glb or .obj meshes, InstaCalc (the game) defines shields, pillars, crystals, and boss props with tiny .ic math equations (polar radii r(θ) = R + a·cos(k·θ), lathe profiles, and twisted extrusions). At load time, geo-dsl.ic → geo-dsl.generated.js and ic-3d.js evaluate the equations into GPU vertex/triangle buffers.
.ic Math Source~118 B
Plain-text parametric equation—readable, diffable, and doctested.
--
Synthesized once at load into WebGL2 Float32Array attributes.
.glb / .obj120–450 KB
Baked vertex dumps are ~1,000× larger than the .ic equation.
The minified production build ships in 145.4 KB gzipped (first three treemap views). The Live bundle breakdown tree below crawls the unbundled, readable dev files served in this folder.
Measured on the built game by the scorecard: 113 KB of code, 7 KB of page and CSS, 25 KB of self-hosted font subsets. Under budget with 4.6 KB to spare; Brotli makes it 129 KB.
Counted separately from the graphics budget. The game ships 176 KB behind the title (the 164 KB math build plus a 12 KB adapter and baked rules), under its 180 KB target.
.ic Share vs host.* Driver Kernel (live from origin)ic-3d.js
.ic Rules
CSS / Browser
Live crawl across play.html, meta/meta.html, and battlebot.html. Click any phase or folder to expand.
This folder serves the game's readable sources, one file each, so these numbers are larger than the scorecard's: the build
(tools/build-game.mjs) bundles, minifies and tree-shakes play.html and Instacalc GL into one script. Gzip here is your browser's
CompressionStream at its default level; the scorecard uses gzip -9, so expect a few percent of difference.
.ic sheets evaluated live by host.rulesEvery rule, style pack, SFX patch, camera spec, and procedural 3D sculpture lives in plain-text .ic.
Click any sheet to inspect its source and run its embedded @example doctests in your browser.
Loading…
Live broad-nib cursive ln + curve-baseline f(x) wave warp rendered in real time via canvas.
ln + golden vector-path tracer along f(x) = sin(kx)Instead of static screenshots, this stage boots the live playable play.html engine in god mode and switches scenarios and art packs on the fly, paired with inline callouts for the active .ic rule and shader pass.
Pop Chain on Desk Day: clearing one stack triggers neighbor pops within the chain radius; each pop steps up the chord in sfx.ic.
r = c·√i, θ = i·2.39996
Hover the canvas to inspect live phase & coordinates.
Each effect is a short .ic sheet whose motion is a pure formula of particle age t, compiled to a shader. 2,512 probes match the Instacalc engine.
Honest trade-offs: symbolic math + 145 KB web boot vs. heavy-art tooling and physics engines.
| Dimension | InstaCalc (.ic + ic-3d.js) | Unity / Godot (Web Export) | Honest Verdict |
|---|---|---|---|
| Bundle & cold boot | ~145 KB gfx + 176 KB CAS · <250 ms | 4–60 MB WASM + assets · 3–12 s | InstaCalc for instant web play |
| Dynamic formulas | Native CAS (derive, integrate, solve) + closure JIT | Requires writing or embedding custom parser/CAS | InstaCalc (by 10× less glue) |
| 3D asset pipeline | 150 B .ic equations → GPU buffers | Blender / Maya → .glb / .fbx + importer | InstaCalc for math; Unity/Godot for art |
| Physics & lighting | Custom springs + single-pass WebGL2 shadows | PhysX/Jolt, PBR, baked GI, post-FX stack | Unity / Godot for heavy 3D worlds |
| Modding & proofs | Plain-text .ic + inline @example doctests | External Lua/WASM sandbox or C# reflection | InstaCalc for safe live rule editing |
AnimationCurve keyframes or lookup tables. Here, x² + 2x − 4 is a live AST: d/dx, ∫, root-finding, and term-splitting happen symbolically, then compile to ~25 ns JS closures..glb blobs: No Blender export-reimport loop, binary git bloat, or fixed LODs. A 3-line .ic equation generates solid meshes, wireframes, and cross-section cutaways at load..ic rules + player scripting: Every balance table, SFX synth patch, camera rig, and autopilot rule is plain text verified by inline /// @example proofs at load—safe for players to edit live.ic-3d.js is built for stylized procedural math, not photogrammetry.physics.ic excels at springs, clay squash-and-stretch, and arena projectiles, not 500-stack Jolt/PhysX ragdoll simulations or navmesh crowd AI..ic sheets rely on ic-agree doctests and browser DevTools."Zero Frame" proved the loop: towers that are formulas, weapons that are operations, zero means destroyed.
.icEvery tunable number and table went into Instacalc sheets, checked against the real engine with ic-agree. Play stayed identical.
An autopilot: playing by hand is free and pays most, your own .ic rules are free, full auto costs battery.
Image-model concepts set the target; a real-time three.js arena was tuned against them with blind reviews until reviewers struggled to tell a game frame from the concept.
Position became x, roots became free pops, asymptotes became bombs, and the neon look retired for a cozy desk.
Newcomer, skilled and critic bots found a 70-second walkover, free wrong answers and a lose screen that blamed the wrong thing. A one-command fun check now replays them after every change.
Eight art styles, a mood composer built on musical modes, and designs for drones and turrets programmed in .ic. Other AIs joined through GitHub issues.
Instacalc GL replaced three.js with frames that match pixel for pixel, ic-slim.mjs replaced stand-in math, and garbage per frame fell from 2.4 MB to 0.34 MB.
| How a change is proven | Tool | What it says today |
|---|---|---|
| Rules match the real engine | ic-agree | 14 sheets · 263 rows · 448 values · all agree |
| The game still plays | play-test.cjs | 178 checks, including a full boss fight |
| Frames match three.js | gl/compare.cjs | 17 of 17 frames pass |
| It is still fun | fun-check.cjs | 9 bots vs a baseline |
| The music obeys its theory | composer-test.cjs | 9,984 bars · every cadence |
| It looks shippable | blind reviewers | core screens read as indie |
The Instacalc engine is the game's math: it loads behind the title, the game asks it once when a stack spawns or a card lands, and its answer is compiled into a function that runs in 5 to 25 nanoseconds, fast enough for every frame. Every answer is exact Instacalc math, checked on 6,278 formulas. That unlocks the features nobody can copy quickly: