Z# Browser Lab

BUILT WITH Z# + WEBASSEMBLY

Small tests.
Real Z#.

A playground for the browser VM. Every interaction below is handled by a Z# script.

● Loading bZVM…

01 / STATE Persistent variables

Keep count

The value stays in the room between clicks.

0
02 / FUNCTIONS Multi-file + returns

A personal hello

Your name goes to a typed function in Secondary.zsharp.

Waiting for a name.
03 / TASKS Non-blocking wait

Take three seconds

Try the counter while this countdown is running.

Ready
04 / REGEX Conditions + matching

Check a lab code

Use three capital letters followed by three digits.

Try ZOS123, then something invalid.
05 / NUMBERS Math + exact decimals

No floating-point surprise

Calculated by Z#, not hardcoded into the page.

0.1 + 0.2—
Math.pow(10, 5)—
100000000000000000001 + 1—
06 / DOM HTML + style

Swap the inside

Replace inner HTML without replacing the card.

Original content

This box is the target.

07 / LOCAL TIME Live getters

Your time, from Z#

Uses this browser's local timezone. Refreshes every 100 ms with a Z# wait.

Loading…
getYear / getMonth / getDay—
getWeek()—
getHour().formatted—
getMS() / getMS(2) / getMS(3)—
08 / UNIX TIME Convert + relative

Pick a moment

Convert a date to Unix seconds, then compare it to now. Try a past and a future date.

— — —
09 / EVENTS Input + submit

More than clicks

Waiting for an event. Start the monitor, then tap E — even a short tap is retained. Pointer: — Platform: —
10 / DOM Selectors + attributes

One ID, different tags

The count selector updates the first two matching IDs, regardless of tag. Repeated IDs here are deliberate test fixtures.

A div · original
A span · original
Another div · stays unchanged
No changes yet.
11 / HTTP Asynchronous requests

Fetch without blocking

Fetch a public file from this site, or enter an HTTPS URL whose server permits browser requests. Requests obey browser CORS rules.

Not requested.
12 / WEBSOCKETS Named connections

Send. Receive. Repeat.

Enter a secure WebSocket URL for a server you control. Connect only when you are ready; this demo does not contact a socket automatically.

Disconnected.
13 / JSON Desktop syntax, browser runtime

Load a typed project file

A filename variable loads a JSON file without blocking the page. Keys and types must match the declared schema. Large decimal values retain their digits.

Ready to load Person.json.