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"); | |
const fmt = std.fmt; | |
const mem = std.mem; | |
const print = std.debug.print; | |
const assert = std.debug.assert; | |
const expect = std.testing.expect; | |
pub var allocator: std.mem.Allocator = undefined; | |
pub fn main() !void { |
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 "core:c/libc" | |
import "core:encoding/json" | |
import "core:fmt" | |
import "core:mem" | |
import "core:os" | |
import "core:path/filepath" | |
import "core:strings" |
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
cmake_minimum_required(VERSION 3.25) | |
### Debug mode | |
# $ cmake -S . -B build-debug -GNinja -DCMAKE_BUILD_TYPE=Debug | |
# $ cmake --build build-debug | |
# $ cmake --install build-debug # SDL2.dllをコピー | |
# $ cmake --build build-debug && build-debug\game.exe | |
### Release mode | |
# $ cmake -S . -B build-release -GNinja -DCMAKE_BUILD_TYPE=Release |
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"); | |
const print = std.debug.print; | |
pub fn main() !void { | |
// Create an allocator. | |
var gpa = std.heap.GeneralPurposeAllocator(.{}){}; | |
defer _ = gpa.deinit(); | |
const allocator = gpa.allocator(); | |
// Parse the URI. |
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"); | |
const builtin = @import("builtin"); | |
const print = std.debug.print; | |
// zig version: 0.12.0-dev.1717+54f4abae2 | |
// test: cmd.exe and powershell.exe | |
const DELIMITER = if (builtin.os.tag == .windows) '\r' else '\n'; | |
pub fn main() !void { |
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 | |
// http://www.nct9.ne.jp/m_hiroi/golang/abcgo33.html#chap02 | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"os" | |
"strings" |
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
@echo off | |
REM Based on https://github.com/michal-z/cgame/blob/main/build.bat | |
SETLOCAL | |
SET NAME=main | |
IF "%1" == "" ( SET MODE=D && GOTO :MAIN | |
) ELSE IF "%1" == "--debug" ( SET MODE=D && GOTO :MAIN |
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 builtin = @import("builtin"); | |
const std = @import("std"); | |
const ChildProcess = std.ChildProcess; | |
const fs = std.fs; | |
const io = std.io; | |
const json = std.json; | |
const math = std.math; | |
const mem = std.mem; | |
const process = std.process; |
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
// 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 |
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 | |
// runtime error | |
import ( | |
"errors" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" |