This file contains 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 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 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 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 ( | |
"encoding/json" | |
"fmt" | |
"os" | |
"strings" | |
_ "embed" |
This file contains 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 ( | |
"encoding/csv" | |
"encoding/json" | |
"flag" | |
"fmt" | |
"io" | |
"net/http" | |
"os" |
This file contains 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 ( | |
"context" | |
"crypto/rand" | |
"encoding/hex" | |
"fmt" | |
"html/template" | |
"net/http" | |
"os" |
This file contains 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 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 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 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); | |
} |