Build and run
$ git init
$ git submodule add https://github.com/ryupold/raylib.zig raylib.zig
$ cd raylib.zig
$ git submodule update --init --recursive
$ cd ..
$ zig build run| const std = @import("std"); | |
| // https://github.com/MasterQ32/SDL.zig | |
| const SDL = @import("sdl2"); // Add this package by using sdk.getNativeModule | |
| // Build and run | |
| // zig build run | |
| pub fn main() !void { | |
| if (SDL.SDL_Init(SDL.SDL_INIT_VIDEO | SDL.SDL_INIT_EVENTS | SDL.SDL_INIT_AUDIO) < 0) |
Build and run
$ git init
$ git submodule add https://github.com/ryupold/raylib.zig raylib.zig
$ cd raylib.zig
$ git submodule update --init --recursive
$ cd ..
$ zig build run| const std = @import("std"); | |
| pub fn build(b: *std.Build) void { | |
| // b.verbose = true; | |
| // b.verbose_link = true; | |
| // b.verbose_cc = true; | |
| const obj = b.addSystemCommand(&.{ "gcc", "-c", "deps/add.c/src/add.c", "-o", "deps/add.c/src/add.o" }); | |
| const libadd = b.addSystemCommand(&.{ "ar", "rcs", "deps/add.c/src/libadd.a", "deps/add.c/src/add.o" }); |
| const std = @import("std"); | |
| pub fn build(b: *std.Build) void { | |
| // b.verbose = true; | |
| // b.verbose_link = true; | |
| // b.verbose_cc = true; | |
| const obj = b.addSystemCommand(&.{ "gcc", "-std=c11", "-c", "deps/xml.c/src/xml.c", "-o", "deps/xml.c/src/xml.o" }); | |
| const deps = b.step("deps", "Build External Dependencies"); |
| const std = @import("std"); | |
| pub fn build(b: *std.build.Builder) void { | |
| const target = b.standardTargetOptions(.{}); | |
| const optimize = b.standardOptimizeOption(.{}); | |
| const exe = b.addExecutable(.{ | |
| .name = "zig-updater", | |
| .root_source_file = .{ .path = "src/main.zig" }, | |
| .target = target, | |
| .optimize = optimize, |
| const std = @import("std"); | |
| pub fn build(b: *std.Build) void { | |
| const target = b.standardTargetOptions(.{}); | |
| const optimize = b.standardOptimizeOption(.{}); | |
| const exe = b.addExecutable(.{ | |
| .name = "ziggy", | |
| .root_source_file = .{ .path = "src/main.zig" }, | |
| .target = target, |
| const std = @import("std"); | |
| const print = std.debug.print; | |
| const eql = std.mem.eql; | |
| const expect = std.testing.expect; | |
| const expectEqual = std.testing.expectEqual; | |
| const expectEqualSlices = std.testing.expectEqualSlices; | |
| const expectEqualStrings = std.testing.expectEqualStrings; | |
| const concat = std.mem.concat; | |
| pub fn main() !void { |
| import std / [bitops, strutils] | |
| proc checkIsPangram(s: string): bool = | |
| var letters: int32 = 0 | |
| for c in s: | |
| if not isAlphaAscii(c): | |
| continue | |
| let lettersIndex = toLowerAscii(c).ord - 'a'.ord | |
| setBit(letters, lettersIndex) |
| package main | |
| // runtime error | |
| import ( | |
| "errors" | |
| "fmt" | |
| "os" | |
| "strconv" | |
| "strings" |
| // Date: 2024/08/22 | |
| // Zig version: 0.14.0-dev.1224+16d74809d | |
| // Build: zig build-exe -Doptimize=ReleaseFast zig_update.zig | |
| // 必要なソフト | |
| // Windows: curl, 7za | |
| // その他(Linux、Macなど): curl | |
| // zigディレクトリの位置 | |
| // Windows: c:\Langs\zig |