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 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 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 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 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
package main | |
// http://www.nct9.ne.jp/m_hiroi/golang/abcgo33.html#chap02 | |
import ( | |
"bufio" | |
"flag" | |
"fmt" | |
"os" | |
"strings" |
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
@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 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 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 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
// 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 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
package main | |
// runtime error | |
import ( | |
"errors" | |
"fmt" | |
"os" | |
"strconv" | |
"strings" |
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
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) |
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 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 { |
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"); | |
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, |