Skip to content

Instantly share code, notes, and snippets.

@doccaico
doccaico / a.html
Last active November 23, 2020 11:22
Nim with Anime.js
<!DOCTYPE html>
<html>
<head>
<script src="anime.min.js"></script>
<style>
body {background-color: #ddd;}
</style>
</head>
<body></body>
@doccaico
doccaico / build.md
Created November 27, 2020 01:18
Fire Emblem - Heroes Remake Gaiden (FEHRG) のビルド方法 (on Linux)

Fire Emblem - Heroes Remake Gaiden (FEHRG) のビルド方法 (on Linux)

# install

$ cd ~/Downloads
$ sudo dpkg -i devkitpro-pacman.amd64.deb
@doccaico
doccaico / main.nim
Last active November 28, 2020 12:12
Roguelike Dungeon Generation
import math, random, strformat, tables
# Original Python version: https://github.com/DanaL/RLDungeonGenerator
type
DungeonSqr = object
sqr: string
Room = object
row: int
col: int
@doccaico
doccaico / how-to-run.md
Created December 25, 2020 06:12
Zig and WASM
$ zig version
0.7.1+ba2f2e139

$ zig build-lib math.zig -target wasm32-freestanding
$ python3 -m http.server 8000

# then open browser
@doccaico
doccaico / main.c
Last active March 19, 2023 18:24
OpenGLとGLFW3 (C)
// Tutorial 1 : Opening a window
// http://www.opengl-tutorial.org/beginners-tutorials/tutorial-1-opening-a-window/#how-to-follow-these-tutorials
// Ubuntu
// gcc main.c -lGL -lGLEW -lglfw && ./a.out
// Windows (MSYS2)
// gcc main.c -lopengl32 -lglfw3 -lglew32
#include <stdio.h>
@doccaico
doccaico / main.cc
Created October 14, 2021 07:42
glfw glwe opengl
// http://codelabo.com/posts/20200228150223
// Ubuntu
// sudo apt get install libglfw3-dev libglew-dev
// Build
// g++ main.cc -lGL -lglfw -lGLEW && ./a.out
#include <fstream>
#include <iostream>
@doccaico
doccaico / main.zig
Last active March 25, 2024 16:00
Conway's Game of Life
// Build: zig build-exe -O ReleaseFast --strip src/main.zig
// Run: zig build run -- -w 70 -h 40 -m "*" -s 0.07 -c 25
// Version: 0.10.0-dev.3475+b3d463c9e
// Date: 2022/08/09
const std = @import("std");
const fmt = std.fmt;
const mem = std.mem;
const os = std.os;
#include "raylib.h"
#include <stdlib.h> // Required for: calloc(), realloc(), free()
#include <string.h> // Required for: memcpy()
// Text to be displayed, must be UTF-8 (save this code file as UTF-8)
// NOTE: It can contain all the required text for the game,
// this text will be scanned to get all the required codepoints
// static char *text = "いろはにほへと ちりぬるを\nわかよたれそ つねならむ\nうゐのおくやま けふこえて\nあさきゆめみし ゑひもせす";
@doccaico
doccaico / main.c
Created March 7, 2023 04:21
メッセージボックス Mingw64 日本語
// gcc main.c -DUNICODE -mwindows; .\a
#include <windows.h>
int WINAPI WinMain(HINSTANCE ins,
HINSTANCE previns,
LPSTR cmdline,
int cmd) {
MessageBox(NULL, TEXT("Hello world."), TEXT("メッセージボックス"), MB_OK);
@doccaico
doccaico / main.c
Last active March 19, 2023 23:19
Triangle (SDL2) on MSYS2
// Build (MSYS2)
// gcc -Wall -pedantic main.c `sdl2-config --cflags --libs`
#include <SDL.h>
#include <stdbool.h>
int main(int argc, char** argv) {
SDL_Init(SDL_INIT_EVERYTHING);
SDL_Window* window = SDL_CreateWindow(