This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import "@preview/cram-snap:0.1.0": cram-snap | |
#set page( | |
paper: "a3", | |
flipped: true, | |
margin: 1cm, | |
) | |
#set text(font: "Inter", weight: "regular", size: 8pt) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
const target = b.resolveTargetQuery(.{ | |
.cpu_arch = .wasm32, | |
.os_tag = .freestanding, | |
}); | |
const hello = b.addExecutable(.{ | |
.name = "hello", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
const c = @cImport({ | |
@cInclude("dos.h"); | |
}); | |
pub const videomode_40x25_8x8: usize = 0; | |
pub const videomode_40x25_9x16: usize = 1; | |
pub const videomode_80x25_8x8: usize = 2; | |
pub const videomode_80x25_8x16: usize = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "fenster.h" | |
#define W 1920 | |
#define H 1080 | |
static void fenster_rect(struct fenster *f, int x, int y, int w, int h, uint32_t c) { | |
for (int row = 0; row < h; row++) { | |
for (int col = 0; col < w; col++) { | |
fenster_pixel(f, x + col, y + row) = c; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io" | |
"log" | |
"net/http" | |
"os" | |
"sync" | |
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const std = @import("std"); | |
pub fn build(b: *std.Build) void { | |
const exe = b.addExecutable(.{ | |
.name = "cart", | |
.root_source_file = .{ .path = "src/main.zig" }, | |
.target = .{ .cpu_arch = .wasm32, .os_tag = .wasi }, | |
.optimize = .ReleaseSmall, | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
zig-cache | |
bin |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tic = @import("tic"); | |
fn pp(c: u8) void { | |
var m: tic.MouseData = .{}; | |
tic.mouse(&m); | |
if (m.left) { | |
const x = m.x - 1; | |
const y = m.y - 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const tic = @import("tic80.zig"); | |
const Rainbow = struct { | |
red: u8 = 255, | |
grn: u8 = 0, | |
blu: u8 = 0, | |
cyRG: bool = true, | |
cyGB: bool = false, | |
cyBR: bool = false, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const math = @import("std").math; | |
const tic = @import("tic80.zig"); | |
export fn BDR(row: i32) void { | |
const urow: u8 = @intCast(row); | |
{ // skygradient | |
scanline(0x42, 0xFF -| urow, 0x99 +| urow); | |
} |