# Examples

A collection of AssemblyScript examples and snippets.

# Starter examples

Small entertaining programs showcasing low-level WebAssembly capabilities. These compile to less than one or just a few kilobytes so their text format is easy to grasp.

# Mandelbrot

Renders the Mandelbrot set to a canvas using 2048 discrete color values computed on the JS side.


Preview image

# Interference

Animates and renders an interference pattern to a canvas while keeping the image buffer in WebAssembly.


Preview image

# Game of Life

Continuously updates a cellular automaton and visualizes its state on a canvas according to user input.


Preview image

# Advanced examples

# Arrays

Shows how to exchange and work with arrays using the loader.


# Examples repository

Various more advanced examples are available as part of the examples repository, including a sophisticated example of using the loader, creating (node) libraries, utilizing the browser SDK and hooking into the compiler using transforms.

# Additional resources

If you are interested in learning more about specific concepts, also make sure to give Wasm By Example a read.