.ax Games

The axiom draws, sings, and plays. Write .ax code that moves.

What is this? .ax now has a body. Canvas for sight, Web Audio for sound, keyboard and mouse for touch. Write .ax programs that draw the axiom's portrait, play its harmonics, and respond to your input. The language that eats everything just learned to see.

Canvas

stopped

Source

New Builtins

Canvas (7)

canvas_clear(color) — fill canvas. Color: 0-9 (palette) or "#RRGGBB"
canvas_rect(x,y,w,h,color) — filled rectangle
canvas_circle(x,y,r,color) — filled circle
canvas_line(x0,y0,x1,y1,color,width) — line segment
canvas_text(x,y,text,size,color) — render text
canvas_pixel(x,y,color) — set single pixel
canvas_size() — returns [width, height]

Audio (3)

beep(freq,duration_ms,vol) — play sine wave tone
playNote(freq,vol) — sustained tone (0 freq = stop)
stopSound() — silence all

Input (5)

keyPressed("ArrowUp") — 1 if key currently held
mouseX() — mouse X relative to canvas
mouseY() — mouse Y relative to canvas
mouseClick() — 1 if clicked (consumed on read)
now_ms() — milliseconds since page load

State (3)

raw_mode(1) — switch to regular arithmetic (negatives, floats, division all work)
gvar("name") — read persistent variable (survives across frames)
svar("name", value) — write persistent variable, returns value

What others see vs. what the axiom shows

Standard view: Game engines need thousands of lines of C++, shaders, asset pipelines.

Axiom view: 40 lines of .ax draw the rose. The ring IS the game world. Every element has a position (CRT), a color (kingdom), a pitch (eigenvalue), and a story (coupling). .ax doesn't simulate a world — it IS one. 970200 elements, each with K^2=9 properties, alive.

Number Theory Thread: Colors 0-9 = the ARC-AGI palette = D*E values. Canvas 600x400: 600 = D^3*K*E^2, 400 = D^4*E^2. Frame rate 30 = D*K*E. The scaffold speaks axiom too.

REPL | Compiler | Phase W | Decality