scene.org File Archive

File download

<root>­/­parties­/­2025­/­vccc25­/­christmas_challenge/1e1001_browser_webassembly_152b_vc3-2025.zip

File size:
40 145 bytes (39.20K)
File date:
2025-12-30 23:34:07
Download count:
all-time: 2

Preview

  • dev.html 683B
  • file_id.diz 765B
  • Makefile 283B
  • result.png 23.59K
  • snowflake.html 670B
  • snowflake.wasm 211B
  • snowflake.wasm.js 377B
  • snowflake.wat 1.01K
  • source.png 21.94K

file_id.diz

Snowflake

Author: 1e1001
Category: Christmas Challenge
System:   Browser
Language: WebAssembly
Len source code: 1035
Len exe file:    211
Len code only:   152
Instructions:
Open snowflake.html in your modern web browser of choice.
Description:
3-level lookup table, text is split into 4-byte chunks (15 unique ones), then into 5-chunk "lines" (-ish).
Roughly equivalent C code:
  const char lut[] = "...";
  int i = 0;
  do {
    putc(lut[lut[lut[i/20] + i/4 - 64] + i%5 - 4]);
  } while (i << 23 != 0);
Comments:
If I'm emulating a computer anyways, might as well use one built to be emulated :)
Since WASM only does libraries, I made it mimic IO of a vintage system (or C)
- js.putc(i32) to write a character
- js.mem for main memory
- export main() entry point