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 x.json2 | |
| import os | |
| struct Tweets { | |
| tweet struct { | |
| created_at string | |
| full_text string | |
| } | |
| } |
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 fmt = std.fmt; | |
| const mem = std.mem; | |
| const print = std.debug.print; | |
| const assert = std.debug.assert; | |
| const expect = std.testing.expect; | |
| // https://medium.com/@tharunappu2004/writing-a-lexer-in-c-a-step-by-step-guide-a1d5c55ac04d | |
| pub var allocator: std.mem.Allocator = undefined; |
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 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; | |
| const S = struct { |
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 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 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 | |
| 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 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
| 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 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 |