- Template: cart_c3 - press "Use this template" and you have a working game.
- Docker image:
ghcr.io/notnullgames/null0-cart-c3:latest(linux/amd64 only - runs emulated on Apple Silicon) - Your code:
cart/main.c3, compiled with c3c - Bindings:
carts/c3/null0.c3(baked into the docker image for you) - WASI is available, so ordinary file and stdio calls work.
building
You do not install c3c - the docker image has it, and the current null0 bindings, baked in. That is the whole point: there is nothing in your project to keep in sync with the engine.
docker run --rm --user $(id -u):$(id -g) --platform linux/amd64 \
-v ./cart:/src -v ./webroot:/out \
ghcr.io/notnullgames/null0-cart-c3:latest mygameThe template wraps that in npm start, which also serves the result and rebuilds when you save.
C3 notes
module mainplusimport null0.
a cart, in C3
This is carts/c3/simple/main.c3 in the engine repo - the same file CI builds into the cart below, so it always compiles.
module main;
import null0;
fn void load() @export("load") {
null0::clear(null0::BLUE);
null0::draw_circle(100, 100, 50, null0::RED);
}
// callbacks (optional - implement as needed)
// fn void update() @export("update") {}
// fn void unload() @export("unload") {}
// fn void buttonUp(int button, uint player) @export("buttonUp") {}
// fn void buttonDown(int button, uint player) @export("buttonDown") {}
// fn void keyUp(int key) @export("keyUp") {}
// fn void keyDown(int key) @export("keyDown") {}
// fn void mouseDown(int button) @export("mouseDown") {}
// fn void mouseUp(int button) @export("mouseUp") {}
// fn void mouseMoved(float x, float y) @export("mouseMoved") {}
carts/c3/simple/main.c3callbacks
A cart implements the callbacks it cares about. In C3 they look like this:
fn void load() @export("load") {}See anatomy of a cart for the full list and what each one is passed.
more C3 carts
the API, in C3
Every null0 function, spelled the way C3 spells it. These are read out of the generated bindings themselves, so they match what your editor completes.
colors (7)
Tint a color with another color.
extern fn Color* color_tint(Color color, Color tint) @wasm("null0", "color_tint");Fade a color.
extern fn Color* color_fade(Color color, float alpha) @wasm("null0", "color_fade");Change the brightness of a color.
extern fn Color* color_brightness(Color color, float factor) @wasm("null0", "color_brightness");Invert a color.
extern fn Color* color_invert(Color color) @wasm("null0", "color_invert");Blend 2 colors together.
extern fn Color* color_alpha_blend(Color dst, Color src) @wasm("null0", "color_alpha_blend");Change contrast of a color.
extern fn Color* color_contrast(Color color, float contrast) @wasm("null0", "color_contrast");Interpolate colors.
extern fn Color* color_bilinear_interpolate(Color color00, Color color01, Color color10, Color color11, float coordinateX, float coordinateY) @wasm("null0", "color_bilinear_interpolate");graphics (75)
Create a new blank image.
extern fn Image new_image(int width, int height, Color color) @wasm("null0", "new_image");Copy an image to a new image.
extern fn Image image_copy(Image image) @wasm("null0", "image_copy");Create an image from a region of another image.
extern fn Image image_subimage(Image image, int x, int y, int width, int height) @wasm("null0", "image_subimage");Clear the screen.
extern fn void clear(Color color) @wasm("null0", "clear");Draw a single pixel on the screen.
extern fn void draw_point(int x, int y, Color color) @wasm("null0", "draw_point");Draw a line on the screen.
extern fn void draw_line(int startPosX, int startPosY, int endPosX, int endPosY, Color color) @wasm("null0", "draw_line");Draw a filled rectangle on the screen.
extern fn void draw_rectangle(int posX, int posY, int width, int height, Color color) @wasm("null0", "draw_rectangle");Draw a filled triangle on the screen.
extern fn void draw_triangle(int x1, int y1, int x2, int y2, int x3, int y3, Color color) @wasm("null0", "draw_triangle");Draw a filled ellipse on the screen.
extern fn void draw_ellipse(int centerX, int centerY, int radiusX, int radiusY, Color color) @wasm("null0", "draw_ellipse");Draw a filled circle on the screen.
extern fn void draw_circle(int centerX, int centerY, int radius, Color color) @wasm("null0", "draw_circle");Draw a filled polygon on the screen.
extern fn void draw_polygon(Vector* points, int numPoints, Color color) @wasm("null0", "draw_polygon");Draw a filled arc on the screen.
extern fn void draw_arc(int centerX, int centerY, float radius, float startAngle, float endAngle, int segments, Color color) @wasm("null0", "draw_arc");Draw a filled round-rectangle on the screen.
extern fn void draw_rectangle_rounded(int x, int y, int width, int height, int cornerRadius, Color color) @wasm("null0", "draw_rectangle_rounded");Draw an image on the screen.
extern fn void draw_image(Image src, int posX, int posY) @wasm("null0", "draw_image");Draw a tinted image on the screen.
extern fn void draw_image_tint(Image src, int posX, int posY, Color tint) @wasm("null0", "draw_image_tint");Draw an image, rotated, on the screen.
extern fn void draw_image_rotated(Image src, int posX, int posY, float degrees, float offsetX, float offsetY, int filter) @wasm("null0", "draw_image_rotated");Draw an image, flipped, on the screen.
extern fn void draw_image_flipped(Image src, int posX, int posY, bool flipHorizontal, bool flipVertical, bool flipDiagonal) @wasm("null0", "draw_image_flipped");Draw an image, scaled, on the screen.
extern fn void draw_image_scaled(Image src, int posX, int posY, float scaleX, float scaleY, float offsetX, float offsetY, int filter) @wasm("null0", "draw_image_scaled");Draw some text on the screen.
extern fn void draw_text(Font font, char* text, int posX, int posY, Color color) @wasm("null0", "draw_text");Save an image to persistant storage.
extern fn void save_image(Image image, char* filename) @wasm("null0", "save_image");Load an image from a file in cart.
extern fn Image load_image(char* filename) @wasm("null0", "load_image");Resize an image, return copy.
extern fn Image image_resize(Image image, int newWidth, int newHeight, int filter) @wasm("null0", "image_resize");Scale an image, return copy.
extern fn Image image_scale(Image image, float scaleX, float scaleY, int filter) @wasm("null0", "image_scale");Replace a color in an image, in-place.
extern fn void image_color_replace(Image image, Color color, Color replace) @wasm("null0", "image_color_replace");Tint a color in an image, in-place.
extern fn void image_color_tint(Image image, Color color) @wasm("null0", "image_color_tint");Fade a color in an image, in-place.
extern fn void image_color_fade(Image image, float alpha) @wasm("null0", "image_color_fade");Copy a font to a new font.
extern fn Font font_copy(Font font) @wasm("null0", "font_copy");Scale a font, return a new font.
extern fn Font font_scale(Font font, float scaleX, float scaleY, int filter) @wasm("null0", "font_scale");Load a BMF font from a file in cart.
extern fn Font load_font_bmf(char* filename, char* characters) @wasm("null0", "load_font_bmf");Load a BMF font from an image.
extern fn Font load_font_bmf_from_image(Image image, char* characters) @wasm("null0", "load_font_bmf_from_image");Measure the size of some text.
extern fn Dimensions* measure_text(Font font, char* text, int textLength) @wasm("null0", "measure_text");Meaure an image (use 0 for screen).
extern fn Dimensions* measure_image(Image image) @wasm("null0", "measure_image");Load a TTY font from a file in cart.
extern fn Font load_font_tty(char* filename, int glyphWidth, int glyphHeight, char* characters) @wasm("null0", "load_font_tty");Load a TTY font from an image.
extern fn Font load_font_tty_from_image(Image image, int glyphWidth, int glyphHeight, char* characters) @wasm("null0", "load_font_tty_from_image");Load a TTF font from a file in cart.
extern fn Font load_font_ttf(char* filename, int fontSize) @wasm("null0", "load_font_ttf");Invert the colors in an image, in-place.
extern fn void image_color_invert(Image image) @wasm("null0", "image_color_invert");Calculate a rectangle representing the available alpha border in an image.
extern fn Rectangle* image_alpha_border(Image image, float threshold) @wasm("null0", "image_alpha_border");Crop an image, in-place.
extern fn void image_crop(Image image, int x, int y, int width, int height) @wasm("null0", "image_crop");Crop an image based on the alpha border, in-place.
extern fn void image_alpha_crop(Image image, float threshold) @wasm("null0", "image_alpha_crop");Adjust the brightness of an image, in-place.
extern fn void image_color_brightness(Image image, float factor) @wasm("null0", "image_color_brightness");Flip an image, in-place.
extern fn void image_flip(Image image, bool horizontal, bool vertical) @wasm("null0", "image_flip");Change the contrast of an image, in-place.
extern fn void image_color_contrast(Image image, float contrast) @wasm("null0", "image_color_contrast");Use an image as an alpha-mask on another image.
extern fn void image_alpha_mask(Image image, Image alphaMask, int posX, int posY) @wasm("null0", "image_alpha_mask");Create a new image, rotating another image.
extern fn Image image_rotate(Image image, float degrees, int filter) @wasm("null0", "image_rotate");Create a new image of a gradient.
extern fn Image image_gradient(int width, int height, Color topLeft, Color topRight, Color bottomLeft, Color bottomRight) @wasm("null0", "image_gradient");Unload an image.
extern fn void unload_image(Image image) @wasm("null0", "unload_image");Unload a font.
extern fn void unload_font(Font font) @wasm("null0", "unload_font");Clear an image.
extern fn void clear_image(Image destination, Color color) @wasm("null0", "clear_image");Draw a single pixel on an image.
extern fn void draw_point_on_image(Image destination, int x, int y, Color color) @wasm("null0", "draw_point_on_image");Draw a line on an image.
extern fn void draw_line_on_image(Image destination, int startPosX, int startPosY, int endPosX, int endPosY, Color color) @wasm("null0", "draw_line_on_image");Draw a filled rectangle on an image.
extern fn void draw_rectangle_on_image(Image destination, int posX, int posY, int width, int height, Color color) @wasm("null0", "draw_rectangle_on_image");Draw a filled triangle on an image.
extern fn void draw_triangle_on_image(Image destination, int x1, int y1, int x2, int y2, int x3, int y3, Color color) @wasm("null0", "draw_triangle_on_image");Draw a filled ellipse on an image.
extern fn void draw_ellipse_on_image(Image destination, int centerX, int centerY, int radiusX, int radiusY, Color color) @wasm("null0", "draw_ellipse_on_image");Draw a circle on an image.
extern fn void draw_circle_on_image(Image destination, int centerX, int centerY, int radius, Color color) @wasm("null0", "draw_circle_on_image");Draw a filled polygon on an image.
extern fn void draw_polygon_on_image(Image destination, Vector* points, int numPoints, Color color) @wasm("null0", "draw_polygon_on_image");Draw a filled round-rectangle on an image.
extern fn void draw_rectangle_rounded_on_image(Image destination, int x, int y, int width, int height, int cornerRadius, Color color) @wasm("null0", "draw_rectangle_rounded_on_image");Draw an image on an image.
extern fn void draw_image_on_image(Image destination, Image src, int posX, int posY) @wasm("null0", "draw_image_on_image");Draw a tinted image on an image.
extern fn void draw_image_tint_on_image(Image destination, Image src, int posX, int posY, Color tint) @wasm("null0", "draw_image_tint_on_image");Draw an image, rotated, on an image.
extern fn void draw_image_rotated_on_image(Image destination, Image src, int posX, int posY, float degrees, float offsetX, float offsetY, int filter) @wasm("null0", "draw_image_rotated_on_image");Draw an image, flipped, on an image.
extern fn void draw_image_flipped_on_image(Image destination, Image src, int posX, int posY, bool flipHorizontal, bool flipVertical, bool flipDiagonal) @wasm("null0", "draw_image_flipped_on_image");Draw an image, scaled, on an image.
extern fn void draw_image_scaled_on_image(Image destination, Image src, int posX, int posY, float scaleX, float scaleY, float offsetX, float offsetY, int filter) @wasm("null0", "draw_image_scaled_on_image");Draw some text on an image.
extern fn void draw_text_on_image(Image destination, Font font, char* text, int posX, int posY, Color color) @wasm("null0", "draw_text_on_image");Draw a outlined (with thickness) rectangle on the screen.
extern fn void draw_rectangle_outline(int posX, int posY, int width, int height, int thickness, Color color) @wasm("null0", "draw_rectangle_outline");Draw a outlined (with thickness) triangle on the screen.
extern fn void draw_triangle_outline(int x1, int y1, int x2, int y2, int x3, int y3, int thickness, Color color) @wasm("null0", "draw_triangle_outline");Draw a outlined (with thickness) ellipse on the screen.
extern fn void draw_ellipse_outline(int centerX, int centerY, int radiusX, int radiusY, int thickness, Color color) @wasm("null0", "draw_ellipse_outline");Draw a outlined (with thickness) circle on the screen.
extern fn void draw_circle_outline(int centerX, int centerY, int radius, int thickness, Color color) @wasm("null0", "draw_circle_outline");Draw a outlined (with thickness) polygon on the screen.
extern fn void draw_polygon_outline(Vector* points, int numPoints, int thickness, Color color) @wasm("null0", "draw_polygon_outline");Draw a outlined (with thickness) arc on the screen.
extern fn void draw_arc_outline(int centerX, int centerY, float radius, float startAngle, float endAngle, int segments, int thickness, Color color) @wasm("null0", "draw_arc_outline");Draw a outlined (with thickness) round-rectangle on the screen.
extern fn void draw_rectangle_rounded_outline(int x, int y, int width, int height, int cornerRadius, int thickness, Color color) @wasm("null0", "draw_rectangle_rounded_outline");Draw a outlined (with thickness) rectangle on an image.
extern fn void draw_rectangle_outline_on_image(Image destination, int posX, int posY, int width, int height, int thickness, Color color) @wasm("null0", "draw_rectangle_outline_on_image");Draw a outlined (with thickness) triangle on an image.
extern fn void draw_triangle_outline_on_image(Image destination, int x1, int y1, int x2, int y2, int x3, int y3, int thickness, Color color) @wasm("null0", "draw_triangle_outline_on_image");Draw a outlined (with thickness) ellipse on an image.
extern fn void draw_ellipse_outline_on_image(Image destination, int centerX, int centerY, int radiusX, int radiusY, int thickness, Color color) @wasm("null0", "draw_ellipse_outline_on_image");Draw a outlined (with thickness) circle on an image.
extern fn void draw_circle_outline_on_image(Image destination, int centerX, int centerY, int radius, int thickness, Color color) @wasm("null0", "draw_circle_outline_on_image");Draw a outlined (with thickness) polygon on an image.
extern fn void draw_polygon_outline_on_image(Image destination, Vector* points, int numPoints, int thickness, Color color) @wasm("null0", "draw_polygon_outline_on_image");Draw a outlined (with thickness) round-rectangle on an image.
extern fn void draw_rectangle_rounded_outline_on_image(Image destination, int x, int y, int width, int height, int cornerRadius, int thickness, Color color) @wasm("null0", "draw_rectangle_rounded_outline_on_image");gui (10)
Begin a GUI window. Returns false if the window is collapsed or closed - skip its contents, but still call gui_end_window.
extern fn bool gui_begin_window(char* title, Rectangle rect) @wasm("null0", "gui_begin_window");End the current GUI window.
extern fn void gui_end_window() @wasm("null0", "gui_end_window");A static text label.
extern fn void gui_label(char* text) @wasm("null0", "gui_label");A block of wrapping text.
extern fn void gui_text(char* text) @wasm("null0", "gui_text");A checkbox. Returns the (possibly changed) state.
extern fn bool gui_checkbox(char* label, bool state) @wasm("null0", "gui_checkbox");A slider. Returns the (possibly changed) value.
extern fn float gui_slider(float value, float low, float high) @wasm("null0", "gui_slider");Set the current layout row - the column widths (negative for flexible), and the row height.
extern fn void gui_layout_row(int* widths, int numWidths, int height) @wasm("null0", "gui_layout_row");Finish building the GUI for this frame. Called automatically at the end of update if you do not call it.
extern fn void gui_end() @wasm("null0", "gui_end");Draw the GUI to an image (0 is the screen).
extern fn void gui_draw(Image dst) @wasm("null0", "gui_draw");input (12)
Has the key been pressed? (tracks unpress/read correctly.)
extern fn bool key_pressed(int key) @wasm("null0", "key_pressed");Is the key currently down?
extern fn bool key_down(int key) @wasm("null0", "key_down");Has the key been released? (tracks press/read correctly.)
extern fn bool key_released(int key) @wasm("null0", "key_released");Is the key currently up?
extern fn bool key_up(int key) @wasm("null0", "key_up");Get current position of mouse.
extern fn Vector* mouse_position() @wasm("null0", "mouse_position");sound (7)
Load a sound from a file in cart.
extern fn Sound load_sound(char* filename) @wasm("null0", "load_sound");Play a sound.
extern fn void play_sound(Sound sound, bool loop) @wasm("null0", "play_sound");Stop a sound.
extern fn void stop_sound(Sound sound) @wasm("null0", "stop_sound");Unload a sound.
extern fn void unload_sound(Sound sound) @wasm("null0", "unload_sound");Speak some text and return a sound. Set things to 0 for defaults.
extern fn Sound tts_sound(char* text, bool phonetic, int pitch, int speed, int throat, int mouth, bool sing) @wasm("null0", "tts_sound");Create Sfx sound.
extern fn Sound sfx_sound(SfxParams* params) @wasm("null0", "sfx_sound");Create Sfx parameters.
extern fn SfxParams* sfx_generate(int type) @wasm("null0", "sfx_generate");tile (38)
Load a tilemap (a Tiled map, exported as JSON) from a file in cart.
extern fn Tilemap load_tilemap(char* filename) @wasm("null0", "load_tilemap");Unload a tilemap.
extern fn void unload_tilemap(Tilemap tilemap) @wasm("null0", "unload_tilemap");Update a tilemap's animation timers (deltaTime is in seconds).
extern fn void tile_update(Tilemap tilemap, float deltaTime) @wasm("null0", "tile_update");Get the size of a tilemap, in tiles.
extern fn Dimensions* tile_map_size(Tilemap tilemap) @wasm("null0", "tile_map_size");Get the size of a single tile of a tilemap, in pixels.
extern fn Dimensions* tile_tile_size(Tilemap tilemap) @wasm("null0", "tile_tile_size");Get a custom property of a tilemap, by name (PROP_NONE when there is no such property.)
extern fn TilemapProp* tile_map_prop(Tilemap tilemap, char* name) @wasm("null0", "tile_map_prop");Get the number of custom properties on a tilemap.
extern fn int tile_map_prop_count(Tilemap tilemap) @wasm("null0", "tile_map_prop_count");Get a custom property of a tilemap, by index (PROP_NONE when out of range.)
extern fn TilemapProp* tile_map_prop_at(Tilemap tilemap, int index) @wasm("null0", "tile_map_prop_at");Draw a tilemap on the screen.
extern fn void tile_draw(Tilemap tilemap, int posX, int posY) @wasm("null0", "tile_draw");Draw a tilemap on the screen, tinted by a color.
extern fn void tile_draw_tint(Tilemap tilemap, int posX, int posY, Color tint) @wasm("null0", "tile_draw_tint");Draw a tilemap on an image.
extern fn void tile_draw_on_image(Image dst, Tilemap tilemap, int posX, int posY) @wasm("null0", "tile_draw_on_image");Render a whole tilemap to a new image.
extern fn Image tilemap_image(Tilemap tilemap) @wasm("null0", "tilemap_image");Get the number of layers in a tilemap. Layers are numbered depth-first, so the children of a group layer have their own indexes too.
extern fn int tile_layer_count(Tilemap tilemap) @wasm("null0", "tile_layer_count");Get the index of a layer of a tilemap, by name (-1 when there is no such layer.)
extern fn int tile_layer_index(Tilemap tilemap, char* name) @wasm("null0", "tile_layer_index");Get the name of a layer of a tilemap.
extern fn char* tile_layer_name(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_name");Get the kind of a layer of a tilemap.
extern fn TileLayerKind tile_layer_type(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_type");Get the size of a layer of a tilemap, in tiles.
extern fn Dimensions* tile_layer_size(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_size");Get whether a layer of a tilemap is visible. Drawing a layer that Tiled marked hidden draws nothing.
extern fn bool tile_layer_visible(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_visible");Get a custom property of a layer of a tilemap, by name (PROP_NONE when there is no such property.)
extern fn TilemapProp* tile_layer_prop(Tilemap tilemap, int layer, char* name) @wasm("null0", "tile_layer_prop");Get the number of custom properties on a layer of a tilemap.
extern fn int tile_layer_prop_count(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_prop_count");Get a custom property of a layer of a tilemap, by index (PROP_NONE when out of range.)
extern fn TilemapProp* tile_layer_prop_at(Tilemap tilemap, int layer, int index) @wasm("null0", "tile_layer_prop_at");Draw a single layer of a tilemap on the screen.
extern fn void tile_draw_layer(Tilemap tilemap, int layer, int posX, int posY) @wasm("null0", "tile_draw_layer");Draw a single layer of a tilemap on the screen, tinted by a color.
extern fn void tile_draw_layer_tint(Tilemap tilemap, int layer, int posX, int posY, Color tint) @wasm("null0", "tile_draw_layer_tint");Draw a single layer of a tilemap on an image.
extern fn void tile_draw_layer_on_image(Image dst, Tilemap tilemap, int layer, int posX, int posY) @wasm("null0", "tile_draw_layer_on_image");Render a single layer of a tilemap to a new image.
extern fn Image tile_layer_image(Tilemap tilemap, int layer) @wasm("null0", "tile_layer_image");Get the gid of the tile at a column/row in a tilemap layer.
extern fn int tile_get_tile(Tilemap tilemap, int layer, int column, int row) @wasm("null0", "tile_get_tile");Set the gid of the tile at a column/row in a tilemap layer. Swapping a gid is how a cart keeps changing state in the map itself.
extern fn void tile_set_tile(Tilemap tilemap, int layer, int column, int row, int gid) @wasm("null0", "tile_set_tile");Draw a single tile from a tilemap on the screen.
extern fn void tile_draw_tile(Tilemap tilemap, int gid, int posX, int posY) @wasm("null0", "tile_draw_tile");Get a copy of the image of a single tile in a tilemap.
extern fn Image tile_image(Tilemap tilemap, int gid) @wasm("null0", "tile_image");Get a custom property of a tile of a tilemap, by name (PROP_NONE when there is no such property.) These come from the tileset, so every tile with this gid shares them.
extern fn TilemapProp* tile_gid_prop(Tilemap tilemap, int gid, char* name) @wasm("null0", "tile_gid_prop");Get the number of custom properties on a tile of a tilemap.
extern fn int tile_gid_prop_count(Tilemap tilemap, int gid) @wasm("null0", "tile_gid_prop_count");Get a custom property of a tile of a tilemap, by index (PROP_NONE when out of range.)
extern fn TilemapProp* tile_gid_prop_at(Tilemap tilemap, int gid, int index) @wasm("null0", "tile_gid_prop_at");Get the number of objects on an object-layer of a tilemap.
extern fn int tile_object_count(Tilemap tilemap, int layer) @wasm("null0", "tile_object_count");Get an object from an object-layer of a tilemap.
extern fn TilemapObject* tile_object(Tilemap tilemap, int layer, int index) @wasm("null0", "tile_object");Get the index of an object on an object-layer of a tilemap, by name (-1 when there is no such object.)
extern fn int tile_object_index(Tilemap tilemap, int layer, char* name) @wasm("null0", "tile_object_index");Get a custom property of an object of a tilemap, by name (PROP_NONE when there is no such property.)
extern fn TilemapProp* tile_object_prop(Tilemap tilemap, int layer, int index, char* name) @wasm("null0", "tile_object_prop");Get the number of custom properties on an object of a tilemap.
extern fn int tile_object_prop_count(Tilemap tilemap, int layer, int index) @wasm("null0", "tile_object_prop_count");Get a custom property of an object of a tilemap, by index (PROP_NONE when out of range.)
extern fn TilemapProp* tile_object_prop_at(Tilemap tilemap, int layer, int index, int propIndex) @wasm("null0", "tile_object_prop_at");utilities (5)
Get system-time (ms) since unix epoch.
extern fn ulong current_time() @wasm("null0", "current_time");Get the change in time (seconds) since the last update run.
extern fn float delta_time() @wasm("null0", "delta_time");Get a random integer between 2 numbers.
extern fn int random_int(int min, int max) @wasm("null0", "random_int");Get the random-seed.
extern fn ulong random_seed_get() @wasm("null0", "random_seed_get");Set the random-seed.
extern fn void random_seed_set(ulong seed) @wasm("null0", "random_seed_set");