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"); | |
fn print_string_contents(buffer: anytype) void { | |
std.debug.print("string print: '{s}'\n", .{ buffer }); | |
std.debug.print("char print:\n", .{}); | |
for (buffer) |b, ind| { | |
std.debug.print(" {d}: {d} {s}", .{ ind, b, buffer[ind..ind+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 std = @import("std"); | |
const c_args = [_][]const u8{ | |
"-std=c++17", | |
"-fno-sanitize=undefined", | |
}; | |
// Although this function looks imperative, note that its job is to | |
// declaratively construct a build graph that will be executed by an external | |
// runner. |
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
/// function for automatically building an imgui (via zgui) UI based | |
/// on struct fields. Really useful when you're moving quickly and | |
/// have a debug flags/fields struct | |
pub fn draw_zgui_ui( | |
for_thing: anytype | |
) !bool | |
{ | |
var buf:[1024:0]u8 = undefined; | |
@memset(&buf, 0); |
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
/// Module that wraps up the zig json system for use in playdate | |
const std = @import("std"); | |
const pdapi = @import("playdate_api_definitions.zig"); | |
pub fn read_from_json_str( | |
input: []const u8, | |
comptime thing_to_read: type, | |
allocator: std.mem.Allocator, | |
) !thing_to_read |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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
Play this game by pasting the script in http://www.puzzlescript.net/editor.html |
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"); | |
/// Explorations of floating point accuracy. to run `zig test inftest.zig` | |
// test "-0 + -1" | |
// { | |
// for (&[_]f32{ 0 }) | |
// |v| | |
// { | |
// inline for (&.{-1, 1}) |
OlderNewer