text stringlengths 32 314k | url stringlengths 93 243 |
|---|---|
//! NOTE: this file is autogenerated, DO NOT MODIFY
//--------------------------------------------------------------------------------
// Section: Constants (3)
//--------------------------------------------------------------------------------
pub const MCAST_CLIENT_ID_LEN = @as(u32, 17);
pub const MCAST_API_VERSION_0 ... | https://raw.githubusercontent.com/OAguinagalde/tinyrenderer/20e140ad9a9483d6976f91c074a2e8a96e2038fb/dep/zigwin32/src/win32/api/multicast.zig |
const std = @import("std");
const tic = @import("../tic80.zig");
const constants = @import("../constants.zig");
const random = @import("./random.zig");
const Vector2 = @import("../entities/Vector2.zig").Vector2;
const TileFlag = enum(u8) {
SOLID = 0,
TONGUE,
ANT,
};
/// This calls tic.mset to set all em... | https://raw.githubusercontent.com/tupini07/games/7496eb0931948fa5f94fcc9452302e860c01af8f/tic80/roris-puff/src/utils/map.zig |
const toUpper = @import("std").ascii.toUpper;
pub fn score(s: []const u8) u32 {
var sum: u32 = 0;
for (s) |c| {
sum += switch (toUpper(c)) {
'A', 'E', 'I', 'O', 'U', 'L', 'N', 'R', 'S', 'T' => 1,
'D', 'G' => 2,
'B', 'C', 'M', 'P' => 3,
'F', 'H', 'V', 'W'... | https://raw.githubusercontent.com/darthyoh/exercism-zig-solutions/c932956f1db36bcbb72fc9395ee970f8a8088320/scrabble-score/scrabble_score.zig |
const std = @import("std");
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target t... | https://raw.githubusercontent.com/Rekihyt/Sifu/9625ad48a62dd6ea3cba0e6e7f0a14c246e779ce/build.zig |
const std = @import("std");
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target t... | https://raw.githubusercontent.com/salo-dea/wormhole/a138e61afb517ef22f99585e0ec7fd968233adbe/build.zig |
const std = @import("std");
const builtin = @import("std").builtin;
const Allocator = std.mem.Allocator;
// Each type added to the array below must have a `default` and `value` members,
// Otherwise a compile time error is generated.
// Compile-time arrays of these types are created *automatically* to make calculation... | https://raw.githubusercontent.com/lucabol/TheWar/56fb079cf3f2c1f082317d03f157aa3d0e998066/zigcomp/src/main.zig |
const std = @import("std");
const os = std.os;
const mem = std.mem;
const c = @import("../c.zig");
const State = @This();
nl_sock: [*c]c.nl_sock,
nl80211_id: c_int,
pub fn init() !State {
var state: State = undefined;
const sock = c.nl_socket_alloc();
if (sock == null) return error.NoMemory;
errdefer ... | https://raw.githubusercontent.com/binarycraft007/reg/ac9c8d45f248e9d0273783f39e1ede3baa3a1d2e/src/nl80211/State.zig |
pub const Cell = @import("cell.zig").Cell;
pub const Grid = @import("grid.zig").Grid;
| https://raw.githubusercontent.com/adia-dev/MAZig/54646652f1428af1787a2d090eab6d5d27864410/src/models/models.zig |
const std = @import("std");
const Lexer = @import("Lexer.zig");
const ast = @import("ast.zig");
const Parser = @import("Parser.zig");
const Analyzer = @import("Analyzer.zig");
const Reporter = @import("Reporter.zig");
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var arena = std.heap... | https://raw.githubusercontent.com/sno2/gpulse/cfbce883fbc88eeaf10d20979669b74ccd7a3d3b/src/main.zig |
const std = @import("std");
pub fn delimitedWriter(writer: anytype, delimeter: u8) DelimitedWriter(@TypeOf(writer)) {
return DelimitedWriter(@TypeOf(writer)).init(writer, delimeter);
}
/// Utility struct for building delimeter-separated strings
pub fn DelimitedWriter(comptime Writer: type) type {
return struc... | https://raw.githubusercontent.com/LordMZTE/dotfiles/1664b23929d525f3e78097e7026d1e947cbc949e/lib/common-zig/src/delimited_writer.zig |
const std = @import("std");
const ArrayList = std.ArrayList;
const Allocator = std.mem.Allocator;
const Vec2i = @import("util").Vec2i;
const vec2i = @import("util").vec2i;
const core = @import("./core.zig");
const Piece = core.piece.Piece;
pub const Game = struct {
alloc: *Allocator,
board: core.Board,
cur... | https://raw.githubusercontent.com/leroycep/hexagonal-chess/ebc60fe485830eccebab5641b0d0523231f40bc5/core/game.zig |
const common = @import("common");
const std = @import("std");
const Race = struct {
time: u64,
distance: u64,
};
fn parseNumbers(input: []const u8, alloc: std.mem.Allocator) ![]u64 {
var numbers = std.ArrayList(u64).init(alloc);
defer numbers.deinit();
var words = std.mem.splitAny(u8, input, " ")... | https://raw.githubusercontent.com/rndm13/AOC2023/58ddc52e6f32b8043368455ee1af1ac88b237e5c/src/day06.zig |
const std = @import("std");
const zmath = @import("zmath");
const ecs = @import("zflecs");
const game = @import("../../aftersun.zig");
const components = game.components;
pub fn groupBy(world: *ecs.world_t, table: *ecs.table_t, id: ecs.entity_t, ctx: ?*anyopaque) callconv(.C) ecs.entity_t {
_ = ctx;
var match:... | https://raw.githubusercontent.com/foxnne/aftersun/63e8d5e0cb3edc332090268dc47f7606bc08dcdb/src/ecs/systems/use.zig |
//! zig-string from https://github.com/JakumSzark/zig-string
//! (C) https://github.com/JakumSzark License: MIT
const std = @import("std");
const assert = std.debug.assert;
/// A variable length collection of characters
pub const String = struct {
/// The internal character buffer
buffer: ?[]u8,
/// The al... | https://raw.githubusercontent.com/Implodent/tangi-zig/363ec9c6f2dd92d704ba21e3bdb9f102d3231d11/src/util/zig-string.zig |
//
// Quiz time. See if you can make this program work!
//
// Solve this any way you like, just be sure the output is:
//
// my_num=42
//
const std = @import("std");
const NumError = error{IllegalNumber};
pub fn main() !void {
const stdout = std.io.getStdOut().writer();
const my_num: u32 = try getNumber(... | https://raw.githubusercontent.com/rin-yato/ziglings/96dc244f28917eccd8c7ee1dcfb8948a311e2aba/exercises/034_quiz4.zig |
//! A simple Hello World zig program.
//! to just run: zig run hello-world.zig
//! to build exe: zig build-exe hello-world.zig
//! to create executable at given path: zig build-exe -femit-bin=/tmp/hello hello-world.zig
const std = @import("std");
const debugPrint = std.debug.print;
const hello_values = @import("hello-... | https://raw.githubusercontent.com/abhishekkr/tutorials_as_code/4b2fd4169bdb387249bdd16bced028b1774fcca7/talks-articles/languages-n-runtimes/zig/hello-world/hello-world.zig |
const std = @import("std");
const zig_cli = @import("zig-cli");
pub var cmd = zig_cli.Command{
.name = "dump",
.target = zig_cli.CommandTarget{
.action = zig_cli.CommandAction{
.exec = run,
},
},
};
fn run() !void {
std.log.err("not implemented yet", .{});
}
| https://raw.githubusercontent.com/rupurt/zodbc/d987525ecf0c5a534b898f4ebf73b77be922ff02/src/cli/cmd/dump.zig |
const std = @import("std");
pub const Package = struct {
module: *std.Build.Module,
emscripten: bool,
pub fn link(pkg: Package, exe: *std.Build.CompileStep) void {
exe.addModule("zems", pkg.module);
}
};
pub fn package(
b: *std.Build,
target: std.zig.CrossTarget,
optimize: std.bui... | https://raw.githubusercontent.com/ckrowland/simulations/45e3732134c04aa4ee1158a1e061c278806e6e95/libs/zems/build.zig |
const std = @import("std");
const Token = @import("Token.zig");
pub var has_errored: bool = false;
fn setErrored() void {
has_errored = true;
}
pub fn clear() void {
has_errored = false;
}
pub fn reportSource(src: Token.Source, message: []const u8) void {
setErrored();
const is_eof = src.lexeme.len ... | https://raw.githubusercontent.com/cg-jl/zlox/6052f7287da44e677bdec6ba955e4fcc4e06acd7/src/context.zig |
//
// Being able to pass types to functions at compile time lets us
// generate code that works with multiple types. But it doesn't
// help us pass VALUES of different types to a function.
//
// For that, we have the 'anytype' placeholder, which tells Zig
// to infer the actual type of a parameter at compile time.
//
/... | https://raw.githubusercontent.com/scorphus/ziglings/81d254230721b647c9fed88e145b1b2cee95c71b/exercises/070_comptime5.zig |
const std = @import("std");
const mymod = @import("mymodule");
pub fn main() !void {
mymod.myfunc();
}
test "mytest" {
mymod.myfunc();
}
| https://raw.githubusercontent.com/speed2exe/playground/3d5bbd1bd740f5cdd992905526f99ea4ed563fde/zig/modules/src/main.zig |
const std = @import("std");
pub fn build(b: *std.build.Builder) !void {
try build_main_exe(b);
try build_test_exe(b);
}
fn build_main_exe(b: *std.build.Builder) !void {
const chess_engine_exe = b.addExecutable(.{ .name = "chess_engine" });
chess_engine_exe.addCSourceFiles(&.{
"./src/BitBoard.c... | https://raw.githubusercontent.com/eunmann/chess-engine/01927d47e059baa122cdaf992e9170f5737ec510/build.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const ArrayList = std.ArrayList;
const Entry = @import("Entry.zig");
const Options = @import("Options.zig");
const PathDepthPair = struct {
path: []const u8,
depth: usize,
};
pub const BreadthFirstWalker = struct {
start_path: []const u8,
... | https://raw.githubusercontent.com/joachimschmidt557/zig-walkdir/414b374b29e73254149efe1c07ce156cab58d437/src/breadth_first.zig |
// --- Day 3: Toboggan Trajectory ---
// With the toboggan login problems resolved, you set off toward the airport.
// While travel by toboggan might be easy, it's certainly not safe: there's very
// minimal steering and the area is covered in trees. You'll need to see which
// angles will take you near the fewest tre... | https://raw.githubusercontent.com/tcard/advent/1bb70deab3c90d2309d801aea1f9938fdd5a5176/2020/3/zig/3_1.zig |
const fmath = @import("index.zig");
pub fn atan2(comptime T: type, x: T, y: T) -> T {
switch (T) {
f32 => @inlineCall(atan2f, x, y),
f64 => @inlineCall(atan2d, x, y),
else => @compileError("atan2 not implemented for " ++ @typeName(T)),
}
}
fn atan2f(y: f32, x: f32) -> f32 {
const p... | https://raw.githubusercontent.com/tiehuis/zig-fmath/d563c833c7b6f49097de9f3dd1d14b82fead6a38/src/atan2.zig |
const std = @import("std");
pub const CodeReminderOptions = struct {
enableCodeRemindersByName: ?[]const u8,
enableCodeRemindersByProposalNumber: ?[]const u8,
};
pub const CodeReminder = struct {
proposal_number: ?u32,
reminder_id: anyerror, //We use anyerror so that any new library can come along and... | https://raw.githubusercontent.com/swan-www/ZigTheForge/65a25d875ee0f3c8b22a4c9d09d4fbaf38494e27/toolchain/dep/module/code_reminder/code_reminder.zig |
const std = @import("std");
const elemental = @import("../../../elemental.zig");
const flutter = @import("../../../flutter.zig");
const Self = @This();
const Base = @import("base.zig");
const Context = @import("../context.zig");
pub const EventKind = enum {
add,
remove,
pub fn toFlutter(self: EventKind) flutter... | https://raw.githubusercontent.com/ExpidusOS/neutron/65ee6242e8ea42d072dfdaf07ee475d18ae5a3e1/src/neutron/displaykit/base/input/mouse.zig |
const std = @import("std");
const Allocator = std.mem.Allocator;
const assert = std.debug.assert;
const core = @import("../index.zig");
const Coord = core.geometry.Coord;
pub fn SparseChunkedMatrix(comptime T: type, comptime default_value: T, comptime options: struct {
metrics: bool = false,
track_dirty_after_... | https://raw.githubusercontent.com/thejoshwolfe/legend-of-swarkland/23f3ad23d9bced75902cf55c6d6cb2063118681d/src/core/matrix.zig |
const std = @import("std");
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();
const expect = std.testing.expect;
pub fn main() !void {
var arena = std.heap.ArenaAllocator.init(std.heap.page_allocator);
defer arena.deinit();
const allocator = &arena.allocator;
const ... | https://raw.githubusercontent.com/dradtke/advent/8c420c8ff28f102c56e5c05852c6d2845edb2ce5/2021/zig/day14/part2.zig |
//! Gimli is a 384-bit permutation designed to achieve high security with high
//! performance across a broad range of platforms, including 64-bit Intel/AMD
//! server CPUs, 64-bit and 32-bit ARM smartphone CPUs, 32-bit ARM
//! microcontrollers, 8-bit AVR microcontrollers, FPGAs, ASICs without
//! side-channel protecti... | https://raw.githubusercontent.com/jedisct1/zig-gimli/b40e6c3d2dfdd3b2de3b8b6cedfc20103bf0e7ef/src/main.zig |
const std = @import("std");
const stdin = std.io.getStdIn().reader();
const stdout = std.io.getStdOut().writer();
const Lexer = @import("lexer.zig").Lexer;
const Token = @import("lexer.zig").Token;
const PROMPT = ">> ";
pub fn main() !void {
try stdout.print("Welcome to Monkey REPL!\n", .{});
try run();
}
f... | https://raw.githubusercontent.com/benclmnt/zig-interpreter/c140bc520db81090f11dff18ffe535ab77ef1fa3/main.zig |
const std = @import("std");
const c = @cImport(@cInclude("blake3.h"));
const fmt = std.fmt;
const mem = std.mem;
const testing = std.testing;
pub fn addTo(step: *std.build.LibExeObjStep, comptime dir: []const u8) void {
step.linkLibC();
step.addIncludeDir(dir ++ "/lib/c");
var defines: std.ArrayListUnma... | https://raw.githubusercontent.com/lithdew/hyperia/c1d166f81b6f011d9a23ef818b620e68eee3f49a/blake3/blake3.zig |
const std = @import("std");
const json = std.json;
const screeps = @import("screeps-bindings");
const Game = screeps.Game;
const Room = screeps.Room;
const Spawn = screeps.Spawn;
const Creep = screeps.Creep;
const Source = screeps.Source;
const Resource = screeps.Resource;
const SearchTarget = screeps.SearchTarget;
co... | https://raw.githubusercontent.com/sullyy9/zig-screeps/3e0fc4228c53059db95faffcdd663f736ec7e7a1/screeps-ai/src/commander/harvest.zig |
const std = @import("std");
const lib = @import("lib");
export fn main() noreturn {
const app: [*]u8 = @ptrFromInt(0x80000);
_ = app;
const uart = lib.io.serial.SerialStream.initUART()
catch unreachable;
const sz = uart.reader().readInt(u32, .little) catch unreachable;
uart.writer().print("... | https://raw.githubusercontent.com/earowley/TartOS/516af585823d293931b4d668205cc83a880477e0/chainloader/main.zig |
const std = @import("std");
const DateTime = @This();
// Default to Unix Epoch
timestamp: i64 = 0,
years: usize = 1970,
months: u8 = 1,
days: u8 = 1,
weekday: u8 = 4,
hours: u8 = 0,
minutes: u8 = 0,
seconds: u8 = 0,
/// Timezone offset in seconds
/// -1200h -> 1200h
/// -43200 -> 43200
tz: ?i32 = null,
/// 1 Indexed... | https://raw.githubusercontent.com/GrayHatter/srctree/ef46efbe4a8395a2fb524c5a17998279b6900a72/src/datetime.zig |
//! NOTE: this file is autogenerated, DO NOT MODIFY
//--------------------------------------------------------------------------------
// Section: Constants (934)
//--------------------------------------------------------------------------------
pub const CM_PROB_NOT_CONFIGURED = @as(u32, 1);
pub const CM_PROB_DEVLOADE... | https://raw.githubusercontent.com/OAguinagalde/tinyrenderer/20e140ad9a9483d6976f91c074a2e8a96e2038fb/dep/zigwin32/src/win32/api/device_and_driver_installation.zig |
// mostly copied from
// https://github.com/michal-z/zig-gamedev/blob/main/libs/common/vectormath.zig
// for learning. I'll just replace this with that file eventually
const std = @import("std");
const assert = std.dbg.assert;
const math = std.math;
const epsilon : f32 = 0.00001;
pub const Vec3 = extern struct {
... | https://raw.githubusercontent.com/joeld42/tk_raytracer/ac5ea947fa26cbeb256223ea9e2e3645534850a0/src/vecmath_j.zig |
const std = @import("std");
const utils_mod = @import("../utils.zig");
const print = utils_mod.print;
const value_mod = @import("../value.zig");
const Value = value_mod.Value;
const ValueType = value_mod.ValueType;
const vm_mod = @import("../vm.zig");
const VM = vm_mod.VM;
pub const TakeError = error{
invalid_t... | https://raw.githubusercontent.com/dstrachan/openk/0a739d96593fe3e1a7ebe54e5b82e2a69f64302a/src/verbs/take.zig |
const std = @import("std");
const builtin = @import("builtin");
const raylib = @import("raylib");
const Window = @import("Window.zig");
const widgets = @import("widgets.zig");
const multiviewer = @import("multiviewer.zig");
const f1_lt = @import("f1_live_timing.zig");
const SharedState = struct {
active_state: ?f1... | https://raw.githubusercontent.com/recursiveGecko/mv-widgets/539ddae8705973a1b89d41a11d81d4790f0627d1/src/main.zig |
const std = @import("std");
const clap = @import("clap");
const builtin = @import("builtin");
const Frontend = @import("frontend.zig");
const no_command_error =
\\No command specified.
\\
\\Commands:
\\
\\ disasm Disassembles a script file into a human readable format.
\\ co... | https://raw.githubusercontent.com/Beyley/zishzingers/009ab5f6213d8fb67dc188bbc95e54165d20b2f7/src/main.zig |
const std = @import("std");
const Build = std.Build;
const Target = Build.Target;
const output_dir = "../../web/dist/wasm";
const test_files = [_][]const u8{ "src/star_math.zig", "src/math_utils.zig", "src/render.zig" };
pub fn build(b: *Build) !void {
const mode = b.standardOptimizeOption(.{});
const default... | https://raw.githubusercontent.com/mjoerussell/onenightonearth/0d8b6aeafb0c50eae302ed0bdfe079f266e882c8/night-math/build.zig |
//! This file implements the ryu floating point conversion algorithm:
//! https://dl.acm.org/doi/pdf/10.1145/3360595
const std = @import("std");
const expectFmt = std.testing.expectFmt;
const special_exponent = 0x7fffffff;
/// Any buffer used for `format` must be at least this large. This is asserted. A runtime chec... | https://raw.githubusercontent.com/ziglang/zig/d9bd34fd0533295044ffb4160da41f7873aff905/lib/std/fmt/format_float.zig |
const std = @import("std");
// Although this function looks imperative, note that its job is to
// declaratively construct a build graph that will be executed by an external
// runner.
pub fn build(b: *std.Build) void {
// Standard target options allows the person running `zig build` to choose
// what target t... | https://raw.githubusercontent.com/eshom/zig-algorithms-practice/159a056b8aafa3caea69b0847609f923283681b7/build.zig |
[{u'bytes': u'0200303630303030343700000000280020006b010100bf000000000000000000000000000000303430303030453400000000000000006b002e',
u'graph': {u'cc': u'1', u'ebbs': u'1', u'edges': u'0', u'nbbs': u'1'},
u'name': u'fcn.0002dfc0',
u'offset': 188352,
u'refs': []},
{u'bytes': u'002000650078..63..6500700074..69006f0... | https://raw.githubusercontent.com/malware-kitten/r2_windows_zignatures/f01816d50e5abac66f2918b261f5b0cab3130ba2/Visual_Studio_14_arm/ptrustu.lib.zig |
const std = @import("std");
const types = @import("../types/ethereum.zig");
// Types
const Address = types.Address;
const Allocator = std.mem.Allocator;
const Hash = types.Hash;
const HmacSha256 = std.crypto.auth.hmac.sha2.HmacSha256;
const Keccak256 = std.crypto.hash.sha3.Keccak256;
const Secp256k1 = std.crypto.ecc.S... | https://raw.githubusercontent.com/Raiden1411/zabi/beee3c26d0eaa6b426fdc62e66cf24626e3be6fa/src/crypto/Signer.zig |
const std = @import("std");
const util = @import("util.zig");
const data = @embedFile("data/day12.txt");
const Vec2 = struct {
x: usize,
y: usize,
};
const Input = struct {
allocator: std.mem.Allocator,
heightfield: [66][66]u8,
dim: Vec2,
start: Vec2,
goal: Vec2,
pub fn init(input_tex... | https://raw.githubusercontent.com/cdwfs/advent2022/67870bb3b2a8435fce687e52be9c23fbed4814a2/src/day12.zig |
// catch_err_return.zig の shortcut
const parseU64 = @import("error_union_parsing_u64.zig").parseU64;
fn doAThing(str: []u8) !void {
const number = try parseU64(str, 10);
_ = number; // ...
} | https://raw.githubusercontent.com/to-na/my-learn-zig/08d5b9bf5244c165efc84a95856fda241e14bc16/errors/try.zig |
const std = @import("std");
const c = @import("internal/c.zig");
const internal = @import("internal/internal.zig");
const log = std.log.scoped(.git);
const git = @import("git.zig");
pub const Credential = extern struct {
credtype: CredentialType,
free: *const fn (*Credential) callconv(.C) void,
pub fn de... | https://raw.githubusercontent.com/leecannon/zig-libgit2/ff3e20b1343f35d639e945795314c05ac23a9d65/src/credential.zig |
const std = @import("std");
const sdl = @import("./sdl.zig");
const components = @import("./components.zig");
const AnimationData = components.AnimationData;
const systems = @import("./systems.zig");
const DstRect = @import("./DstRect.zig");
const Explosion = @This();
const GameState = @import("./GameState.zig");
remo... | https://raw.githubusercontent.com/abradley2/zig-space-game/a9253ac5c959fa9da438ede65332ee9eeb43781c/src/Explosion.zig |
const std = @import("std");
const utils = @import("../utils.zig");
const allocator = @import("../allocator.zig").kernel_allocator;
var row: u16 = 0;
var column: u16 = 0;
var color: u16 = 0x0F;
var buffer = @intToPtr([*]volatile u16, 0xB8000);
fn newLine() void {
row += 1;
column = 0;
}
fn incrementCursor() v... | https://raw.githubusercontent.com/uiaict/2023-ikt218-osdev/4aa33bb80f93d26e990fbd232683906d9c0c20c0/group_OSDev_18/src/driver/Console.zig |
pub use @cImport({
@cInclude("stb_image.h");
@cInclude("cglm/cglm.h");
}); | https://raw.githubusercontent.com/fu5ha/thunderclap/f70a9ea4236273989a7d008d5c4ad7a11e48b7f5/src/c.zig |
const std = @import("std");
const print = std.debug.print;
pub fn main() !void {
var gpa = std.heap.GeneralPurposeAllocator(.{}){};
var file = try std.fs.cwd().openFile("src/03_input.dat", std.fs.File.OpenFlags{ .read = true });
defer file.close();
var len = try file.getEndPos();
var content = try... | https://raw.githubusercontent.com/Falconerd/advent-of-zig/ec347f539b283c3d86265f7e13ba0e9ef200c0af/src/03.zig |
const std = @import("std");
const logging = @import("main.zig").logging;
pub const rl = @cImport({
@cInclude("raylib.h");
//@cInclude("raymath.h");
//@cInclude("raygui.h");
});
pub fn init() !void {
const screen_width: i32 = 800;
const screen_height: i32 = 450;
rl.SetExitKey(rl.KEY_ESCAPE);
... | https://raw.githubusercontent.com/Angluca/raylib-zig-template/13fa08ba03c61f77cb60fc21ddc6493a693ade0d/src/game.zig |
const std = @import("std");
const Console = @import("utils/debug.zig").Console;
// --------------------------------------------------------------------------
// Enum
// --------------------------------------------------------------------------
pub const Resolution = enum { truecolor, planes };
// --------------------... | https://raw.githubusercontent.com/shazz/ZigMachine/ae4d23e2749f9bdbc6ad225909e63e6c5df487b8/src/zigos.zig |
pub const human = [_][]const u8{ "แดง", "ส้ม", "เหลือง", "เขียว", "น้ำเงิน", "น้ำตาล", "ม่วง", "ขาว", "ดำ", "เทา", "ชมพู", "เขียวเข้ม", "เขียวอ่อน", "เขียวเหลือง", "ฟ้า", "โรสโกล์ด", "ทอง", "เงิน" };
| https://raw.githubusercontent.com/cksac/faker-zig/5a51eb6e6aa4ce50a25a354affca36e8fa059675/src/locales/th/color.zig |
const std = @import("std.zig");
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
const mem = std.mem;
const math = std.math;
const Allocator = mem.Allocator;
/// A contiguous, growable list of items in memory.
/// This is a wrapper around an array of T values. Initialize with `init`.
... | https://raw.githubusercontent.com/ziglang/zig-bootstrap/ec2dca85a340f134d2fcfdc9007e91f9abed6996/zig/lib/std/array_list.zig |
const std = @import("std.zig");
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
const mem = std.mem;
const math = std.math;
const Allocator = mem.Allocator;
/// A contiguous, growable list of items in memory.
/// This is a wrapper around an array of T values. Initialize with `init`.
... | https://raw.githubusercontent.com/cyberegoorg/cetech1-zig/7438a7b157a4047261d161c06248b54fe9d822eb/lib/std/array_list.zig |
const std = @import("std.zig");
const debug = std.debug;
const assert = debug.assert;
const testing = std.testing;
const mem = std.mem;
const math = std.math;
const Allocator = mem.Allocator;
/// A contiguous, growable list of items in memory.
/// This is a wrapper around an array of T values. Initialize with `init`.
... | https://raw.githubusercontent.com/kassane/zig-mos-bootstrap/19aac4779b9e93b0e833402c26c93cfc13bb94e2/zig/lib/std/array_list.zig |
const std = @import("std");
const raylib = @import("src/build.zig");
// This has been tested to work with zig 0.12.0
pub fn build(b: *std.Build) !void {
try raylib.build(b);
}
// expose helper functions to user's build.zig
pub const addRaylib = raylib.addRaylib;
pub const addRaygui = raylib.addRaygui;
| https://raw.githubusercontent.com/yassineb23/Bricks/9b1a194ad1a6653d1822c22208e505566105326c/raylib-master/build.zig |
const std = @import("std");
const raylib = @import("src/build.zig");
// This has been tested to work with zig 0.12.0
pub fn build(b: *std.Build) !void {
try raylib.build(b);
}
// expose helper functions to user's build.zig
pub const addRaylib = raylib.addRaylib;
pub const addRaygui = raylib.addRaygui;
| https://raw.githubusercontent.com/Atan-D-RP4/plug_raylib/d3a85527ba55d660f9eaf7155ec22b96830c5c35/raylib/build.zig |
const std = @import("std");
const raylib = @import("src/build.zig");
// This has been tested to work with zig 0.12.0
pub fn build(b: *std.Build) !void {
try raylib.build(b);
}
// expose helper functions to user's build.zig
pub const addRaylib = raylib.addRaylib;
pub const addRaygui = raylib.addRaygui;
| https://raw.githubusercontent.com/alxrsc/hangman-game/07f6f88c73d8e9c91823356c74d6b65b4d86181f/raylib-master/build.zig |
const std = @import("std");
const raylib = @import("src/build.zig");
// This has been tested to work with zig 0.12.0
pub fn build(b: *std.Build) !void {
try raylib.build(b);
}
// expose helper functions to user's build.zig
pub const addRaylib = raylib.addRaylib;
pub const addRaygui = raylib.addRaygui;
| https://raw.githubusercontent.com/PieterAndriesBerg/BuasIntake_Assignment/ead68712b5004dcf3d9e8ff88e7ecbd56ae3f3ab/external/raylib/build.zig |
pub fn from(addr: usize) []Partition {
return @intToPtr([*]Partition, addr)[0..4];
}
pub fn first_bootable(parts: []Partition) ?*Partition {
for (parts) |*part| {
if (part.is_bootable()) {
return part;
}
}
return null;
}
pub const Partition = packed struct {
attributes:... | https://raw.githubusercontent.com/les-amateurs/AmateursCTF-Public/b9b40a55969e3e1553ed14e66bb460a9370db509/2023/pwn/simpleOS/src/common/partitions.zig |
pub fn from(addr: usize) []Partition {
return @intToPtr([*]Partition, addr)[0..4];
}
pub fn first_bootable(parts: []Partition) ?*Partition {
for (parts) |*part| {
if (part.is_bootable()) {
return part;
}
}
return null;
}
pub const Partition = packed struct {
attributes:... | https://raw.githubusercontent.com/frankiehuangg/CTFs/aa6648124b336ddafe1f2df08acfbfba45ac3af6/Writeups/Online/AmateursCTF%202023/simpleOS/src/common/partitions.zig |
pub fn from(addr: usize) []Partition {
return @intToPtr([*]Partition, addr)[0..4];
}
pub fn first_bootable(parts: []Partition) ?*Partition {
for (parts) |*part| {
if (part.is_bootable()) {
return part;
}
}
return null;
}
pub const Partition = packed struct {
attributes:... | https://raw.githubusercontent.com/unvariant/blog/376e80d734b39b4edcb2a1c341fec0b141328009/src/blog/writeups/amateursctf-2023/pwn-simpleOS/src/common/partitions.zig |
//! run 'zig build jsons' to generate bindings for raylib
//! run 'zig build raylib_parser' to build the raylib_parser.exe
/// this needs to be here so the zig compiler won't complain that there is no entry point
/// but actually we are using main() of 'raylib/src/parser/raylib_parser.c'
pub extern fn main() c_int;
| https://raw.githubusercontent.com/ryupold/raygui.zig/1d0fc91680db1285126853cefc0e76df1ea9edc1/raylib_parser.zig |
//! run 'zig build jsons' to generate bindings for raylib
//! run 'zig build raylib_parser' to build the raylib_parser.exe
/// this needs to be here so the zig compiler won't complain that there is no entry point
/// but actually we are using main() of 'raylib/src/parser/raylib_parser.c'
pub extern fn main() c_int;
| https://raw.githubusercontent.com/AnthonyYeh/raylib.zig0.11.0/ed9b58078673ea0dbbdc53c2f339d74c47ca449b/raylib.zig/raylib_parser.zig |
//! run 'zig build jsons' to generate bindings for raylib
//! run 'zig build raylib_parser' to build the raylib_parser.exe
/// this needs to be here so the zig compiler won't complain that there is no entry point
/// but actually we are using main() of 'raylib/src/parser/raylib_parser.c'
pub extern fn main() c_int;
| https://raw.githubusercontent.com/AnthonyYeh/bouncelang/013cd8150a4bf8b6c3e4ff99e32cba5236b873ed/raylib.zig/raylib_parser.zig |
const std = @import("../../../std.zig");
const kern = @import("kern.zig");
const PtRegs = @compileError("TODO missing os bits: PtRegs");
const TcpHdr = @compileError("TODO missing os bits: TcpHdr");
const SkFullSock = @compileError("TODO missing os bits: SkFullSock");
// in BPF, all the helper calls
// TODO: when htt... | https://raw.githubusercontent.com/ziglang/zig-bootstrap/ec2dca85a340f134d2fcfdc9007e91f9abed6996/zig/lib/std/os/linux/bpf/helpers.zig |
const std = @import("../../../std.zig");
const kern = @import("kern.zig");
const PtRegs = @compileError("TODO missing os bits: PtRegs");
const TcpHdr = @compileError("TODO missing os bits: TcpHdr");
const SkFullSock = @compileError("TODO missing os bits: SkFullSock");
// in BPF, all the helper calls
// TODO: when htt... | https://raw.githubusercontent.com/cyberegoorg/cetech1-zig/7438a7b157a4047261d161c06248b54fe9d822eb/lib/std/os/linux/bpf/helpers.zig |
const std = @import("../../../std.zig");
const kern = @import("kern.zig");
const PtRegs = @compileError("TODO missing os bits: PtRegs");
const TcpHdr = @compileError("TODO missing os bits: TcpHdr");
const SkFullSock = @compileError("TODO missing os bits: SkFullSock");
// in BPF, all the helper calls
// TODO: when htt... | https://raw.githubusercontent.com/2lambda123/ziglang-zig/d7563a7753393d7f0d1af445276a64b8a55cb857/lib/std/os/linux/bpf/helpers.zig |
const std = @import("../../../std.zig");
const kern = @import("kern.zig");
const PtRegs = @compileError("TODO missing os bits: PtRegs");
const TcpHdr = @compileError("TODO missing os bits: TcpHdr");
const SkFullSock = @compileError("TODO missing os bits: SkFullSock");
// in BPF, all the helper calls
// TODO: when htt... | https://raw.githubusercontent.com/2lambda123/ziglang-zig-bootstrap/f56dc0fd298f41c8cc2a4f76a9648111e6c75503/zig/lib/std/os/linux/bpf/helpers.zig |
//
// We've absorbed a lot of information about the variations of types
// we can use in Zig. Roughly, in order we have:
//
// u8 single item
// *u8 single-item pointer
// []u8 slice (size known at runtime)
// [5]u8 array ... | https://raw.githubusercontent.com/evopen/ziglings/614e7561737c340dcf8d7022b8e5bf8bcf22d84a/exercises/058_quiz7.zig |
//
// We've absorbed a lot of information about the variations of types
// we can use in Zig. Roughly, in order we have:
//
// u8 single item
// *u8 single-item pointer
// []u8 slice (size known at runtime)
// [5]u8 array ... | https://raw.githubusercontent.com/sreyasr/ziglings/ce91714862bf3563482d71af9c1b5fc09981d606/exercises/058_quiz7.zig |
//
// We've absorbed a lot of information about the variations of types
// we can use in Zig. Roughly, in order we have:
//
// u8 single item
// *u8 single-item pointer
// []u8 slice (size known at runtime)
// [5]u8 array ... | https://raw.githubusercontent.com/Mentioum/ziglings/10ea4ec88628454fd3a9dc14bcadd335b5405fce/exercises/058_quiz7.zig |
//
// We've absorbed a lot of information about the variations of types
// we can use in Zig. Roughly, in order we have:
//
// u8 single item
// *u8 single-item pointer
// []u8 slice (size known at runtime)
// [5]u8 array ... | https://raw.githubusercontent.com/knavels/knavels-ziglings-solutions/3c8309b5f3aaefaaa0771806d5b42c42b878cc30/058_quiz7.zig |
const common = @import("./common.zig");
const addf3 = @import("./addf3.zig").addf3;
pub const panic = common.panic;
comptime {
@export(__addhf3, .{ .name = "__addhf3", .linkage = common.linkage, .visibility = common.visibility });
}
fn __addhf3(a: f16, b: f16) callconv(.C) f16 {
return addf3(f16, a, b);
}
| https://raw.githubusercontent.com/kassane/zig-mos-bootstrap/19aac4779b9e93b0e833402c26c93cfc13bb94e2/zig/lib/compiler_rt/addhf3.zig |
const common = @import("./common.zig");
const addf3 = @import("./addf3.zig").addf3;
pub const panic = common.panic;
comptime {
@export(__addhf3, .{ .name = "__addhf3", .linkage = common.linkage, .visibility = common.visibility });
}
fn __addhf3(a: f16, b: f16) callconv(.C) f16 {
return addf3(f16, a, b);
}
| https://raw.githubusercontent.com/beingofexistence13/multiversal-lang/dd769e3fc6182c23ef43ed4479614f43f29738c9/zig/lib/compiler_rt/addhf3.zig |
const common = @import("./common.zig");
const addf3 = @import("./addf3.zig").addf3;
pub const panic = common.panic;
comptime {
@export(__addhf3, .{ .name = "__addhf3", .linkage = common.linkage, .visibility = common.visibility });
}
fn __addhf3(a: f16, b: f16) callconv(.C) f16 {
return addf3(f16, a, b);
}
| https://raw.githubusercontent.com/2lambda123/ziglang-zig-bootstrap/f56dc0fd298f41c8cc2a4f76a9648111e6c75503/zig/lib/compiler_rt/addhf3.zig |
const common = @import("./common.zig");
const addf3 = @import("./addf3.zig").addf3;
pub const panic = common.panic;
comptime {
@export(__addhf3, .{ .name = "__addhf3", .linkage = common.linkage, .visibility = common.visibility });
}
fn __addhf3(a: f16, b: f16) callconv(.C) f16 {
return addf3(f16, a, b);
}
| https://raw.githubusercontent.com/matpx/daydream/018ad0c7caaf796d8a04b882fcbed39ccb7c9cd8/toolchain/zig/lib/compiler_rt/addhf3.zig |
const std = @import("std");
const builtin = @import("builtin");
const tests = @import("test/tests.zig");
const Build = std.Build;
const CompileStep = Build.CompileStep;
const Step = Build.Step;
const Child = std.process.Child;
const assert = std.debug.assert;
const join = std.fs.path.join;
const print = std.debug.pri... | https://raw.githubusercontent.com/cin4ed/ziglings/6a43e4b01d80c47a32d883eba87d7c24886335bd/build.zig |
const std = @import("std");
const builtin = @import("builtin");
const tests = @import("test/tests.zig");
const Build = std.Build;
const CompileStep = Build.CompileStep;
const Step = Build.Step;
const Child = std.process.Child;
const assert = std.debug.assert;
const join = std.fs.path.join;
const print = std.debug.pri... | https://raw.githubusercontent.com/leytzher/ziglings/a71726b0d0fc8bf7e34bdbe7295e11eee805bdbd/build.zig |
const std = @import("std");
const builtin = @import("builtin");
const tests = @import("test/tests.zig");
const Build = std.Build;
const CompileStep = Build.CompileStep;
const Step = Build.Step;
const Child = std.process.Child;
const assert = std.debug.assert;
const join = std.fs.path.join;
const print = std.debug.pri... | https://raw.githubusercontent.com/pcapp/ziglings/d5025d7a455ec15c71e01875bff44eb3ba4cfc62/build.zig |
const std = @import("std");
const builtin = @import("builtin");
const tests = @import("test/tests.zig");
const Build = std.Build;
const CompileStep = Build.CompileStep;
const Step = Build.Step;
const Child = std.process.Child;
const assert = std.debug.assert;
const join = std.fs.path.join;
const print = std.debug.pri... | https://raw.githubusercontent.com/fajaralfa/ziglings/4951c90cb68d81d2ce60dd5feac87d683b636b70/build.zig |
// FNV1a - Fowler-Noll-Vo hash function
//
// FNV1a is a fast, non-cryptographic hash function with fairly good distribution properties.
//
// https://tools.ietf.org/html/draft-eastlake-fnv-14
const std = @import("std");
const testing = std.testing;
pub const Fnv1a_32 = Fnv1a(u32, 0x01000193, 0x811c9dc5);
pub const F... | https://raw.githubusercontent.com/ziglang/zig-bootstrap/ec2dca85a340f134d2fcfdc9007e91f9abed6996/zig/lib/std/hash/fnv.zig |
// FNV1a - Fowler-Noll-Vo hash function
//
// FNV1a is a fast, non-cryptographic hash function with fairly good distribution properties.
//
// https://tools.ietf.org/html/draft-eastlake-fnv-14
const std = @import("std");
const testing = std.testing;
pub const Fnv1a_32 = Fnv1a(u32, 0x01000193, 0x811c9dc5);
pub const F... | https://raw.githubusercontent.com/kassane/zig-mos-bootstrap/19aac4779b9e93b0e833402c26c93cfc13bb94e2/zig/lib/std/hash/fnv.zig |
// FNV1a - Fowler-Noll-Vo hash function
//
// FNV1a is a fast, non-cryptographic hash function with fairly good distribution properties.
//
// https://tools.ietf.org/html/draft-eastlake-fnv-14
const std = @import("std");
const testing = std.testing;
pub const Fnv1a_32 = Fnv1a(u32, 0x01000193, 0x811c9dc5);
pub const F... | https://raw.githubusercontent.com/beingofexistence13/multiversal-lang/dd769e3fc6182c23ef43ed4479614f43f29738c9/zig/lib/std/hash/fnv.zig |
// FNV1a - Fowler-Noll-Vo hash function
//
// FNV1a is a fast, non-cryptographic hash function with fairly good distribution properties.
//
// https://tools.ietf.org/html/draft-eastlake-fnv-14
const std = @import("std");
const testing = std.testing;
pub const Fnv1a_32 = Fnv1a(u32, 0x01000193, 0x811c9dc5);
pub const F... | https://raw.githubusercontent.com/2lambda123/ziglang-zig-bootstrap/f56dc0fd298f41c8cc2a4f76a9648111e6c75503/zig/lib/std/hash/fnv.zig |
//! This tool generates SPIR-V features from the grammar files in the SPIRV-Headers
//! (https://github.com/KhronosGroup/SPIRV-Headers/) and SPIRV-Registry (https://github.com/KhronosGroup/SPIRV-Registry/)
//! repositories. Currently it only generates a basic feature set definition consisting of versions, extensions an... | https://raw.githubusercontent.com/2lambda123/ziglang-zig-bootstrap/f56dc0fd298f41c8cc2a4f76a9648111e6c75503/zig/tools/update_spirv_features.zig |
//
// Remember how a function with 'suspend' is async and calling an
// async function without the 'async' keyword makes the CALLING
// function async?
//
// fn fooThatMightSuspend(maybe: bool) void {
// if (maybe) suspend {}
// }
//
// fn bar() void {
// fooThatMightSuspend(true); // Now ba... | https://raw.githubusercontent.com/Andriamanitra/ziglings-solutions/b2c252c0d33c54c5a8aa5003b31d82803e58c884/exercises/090_async7.zig |
//
// Remember how a function with 'suspend' is async and calling an
// async function without the 'async' keyword makes the CALLING
// function async?
//
// fn fooThatMightSuspend(maybe: bool) void {
// if (maybe) suspend {}
// }
//
// fn bar() void {
// fooThatMightSuspend(true); // Now ba... | https://raw.githubusercontent.com/sharpobject/ziglings/1c618a0850c2f65050016e59ab5893bde3134b80/exercises/090_async7.zig |
//
// Remember how a function with 'suspend' is async and calling an
// async function without the 'async' keyword makes the CALLING
// function async?
//
// fn fooThatMightSuspend(maybe: bool) void {
// if (maybe) suspend {}
// }
//
// fn bar() void {
// fooThatMightSuspend(true); // Now ba... | https://raw.githubusercontent.com/booniepepper/hiljusti-ziglings/78dda7c125aa6a727c95e92c623f670f9dae0123/exercises/090_async7.zig |
//
// Remember how a function with 'suspend' is async and calling an
// async function without the 'async' keyword makes the CALLING
// function async?
//
// fn fooThatMightSuspend(maybe: bool) void {
// if (maybe) suspend {}
// }
//
// fn bar() void {
// fooThatMightSuspend(true); // Now ba... | https://raw.githubusercontent.com/Br1ght0ne/ziglings/69f79e05b6b313a5b866d30bbed5c7bc3657561c/exercises/090_async7.zig |
const std = @import("std");
const tic = @import("../tic80.zig");
const constants = @import("../constants.zig");
const random = @import("./random.zig");
const Vector2 = @import("../entities/Vector2.zig").Vector2;
const TileFlag = enum(u8) {
SOLID = 0,
TONGUE,
ANT,
};
/// This calls tic.mset to set all em... | https://raw.githubusercontent.com/tupini07/games/7496eb0931948fa5f94fcc9452302e860c01af8f/tic80/zig_test/src/utils/map.zig |
//
// Being able to pass types to functions at compile time lets us
// generate code that works with multiple types. But it doesn't
// help us pass VALUES of different types to a function.
//
// For that, we have the 'anytype' placeholder, which tells Zig
// to infer the actual type of a parameter at compile time.
//
/... | https://raw.githubusercontent.com/cyplo/ziglings/c42340bff3802f8feb0dbb9b8f04fcf120baef6d/exercises/070_comptime5.zig |
//
// Being able to pass types to functions at compile time lets us
// generate code that works with multiple types. But it doesn't
// help us pass VALUES of different types to a function.
//
// For that, we have the 'anytype' placeholder, which tells Zig
// to infer the actual type of a parameter at compile time.
//
/... | https://raw.githubusercontent.com/isubasinghe/ziglings/ebc4606d7045d8f7a6cffe5e81abe8a9229fea7a/exercises/070_comptime5.zig |
//
// Being able to pass types to functions at compile time lets us
// generate code that works with multiple types. But it doesn't
// help us pass VALUES of different types to a function.
//
// For that, we have the 'anytype' placeholder, which tells Zig
// to infer the actual type of a parameter at compile time.
//
/... | https://raw.githubusercontent.com/yeya24/ziglings/e3e4d962cfd7a3303d02b5da2f0499d3442d1700/exercises/070_comptime5.zig |
//
// Being able to pass types to functions at compile time lets us
// generate code that works with multiple types. But it doesn't
// help us pass VALUES of different types to a function.
//
// For that, we have the 'anytype' placeholder, which tells Zig
// to infer the actual type of a parameter at compile time.
//
/... | https://raw.githubusercontent.com/svin24/ziglings/c2fa14cb297af8be22422edb500aa69ea7e4612a/exercises/070_comptime5.zig |
const std = @import("std");
const config = @import("config");
const util = @import("../util.zig");
const io = @import("io.zig");
const CH_OFFSET = 0;
var serial_base: []u8 = undefined;
pub fn serial_io_handler(offset: u32, len: usize, is_write: bool) void {
std.debug.assert(len == 1);
switch (offset) {
... | https://raw.githubusercontent.com/Judehahh/nemu-zig/8ad1369ffb096c6ff5ee7944ccf9e9bc4af76787/src/device/serial.zig |
const regs = @import("./register.zig");
pub fn CSR(comptime xlen: type) type {
return struct {
pub fn r_plicbase() xlen {
return asm volatile (
\\ csrr %0, 0xfc1
: [ret] "=r" (-> xlen),
);
}
pub fn r_mtime() xlen {
return... | https://raw.githubusercontent.com/chaoyangnz/rvz/275b98dcdb29d55a421872af0664711f2f432804/src/kernel/arch/riscv.zig |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.