Skip to content

Instantly share code, notes, and snippets.

View youz's full-sized avatar
🈳
kyomu

Yōsuke Ushiki youz

🈳
kyomu
View GitHub Profile
@youz
youz / ack-3-1.pdf
Last active September 5, 2023 01:44
SATySFiでアッカーマン関数
View ack-3-1.pdf
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@youz
youz / solve_m23.lisp
Last active June 24, 2023 02:54
EQUALINE Mission 23 solver (in common lisp)
View solve_m23.lisp
;;; EQUALINE Mission 23 solver
(defstruct kifu
(boards (list #(1 :+ 1 :+ 1 :+ 1 :+ 1))) ; 盤面のリスト (逆順)
(routes nil) ; 指し手(int list)のリスト (逆順)
)
(defun print-kifu (k)
(loop for b in (reverse (kifu-boards k))
for r in (cons nil (reverse (kifu-routes k)))
@youz
youz / gaming.hlsl
Last active May 26, 2023 16:18
Windows Terminal 1.6pre ピクセルシェーダ+Rubyスクリプトでアニメーション
View gaming.hlsl
Texture2D shaderTexture;
SamplerState samplerState;
cbuffer PixelShaderSettings {
float Time;
float Scale;
float2 Resolution;
float4 Background;
};
@youz
youz / grid.hlsl
Last active May 26, 2023 16:05
shaders for Windows Terminal
View grid.hlsl
Texture2D shaderTexture;
SamplerState samplerState;
cbuffer PixelShaderSettings {
float Time;
float Scale;
float2 Resolution;
float4 Background;
};
@youz
youz / ente.l
Created May 6, 2013 03:53
xyttrでエンテイスラ語<->英語翻訳コマンドとかフィルタとか
View ente.l
;;; -*- mode:lisp; package:xyttr -*-
;;; ref. http://otanews.livedoor.biz/archives/51944341.html
(in-package :xyttr)
(defparameter *alpha* "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz")
(defparameter *ente* "AZYXEWVTISRLPNOMQKJHUGFDCBazyxewvtisrlpnomqkjhugfdcb")
(defun en-to-ente-popup ()
@youz
youz / pi.atl
Last active January 10, 2023 15:53
Atlas https://github.com/darrenks/atlas で円周率1000桁計算
View pi.atl
# ref. https://www.cs.ox.ac.uk/people/jeremy.gibbons/publications/spigot.pdf
i=2:1+i
q=1:10*q*i*~1-2*i
r=180:10*u*(q*~2-5*i)+r-y*t
t=60:t*u
u=6+i*27+i*27
y=((q*~12-27*i)+5*r)/5*t
c='0+1001[y
([c):'.:>c
@youz
youz / make.bat
Last active October 13, 2022 16:30
quine.grass
View make.bat
@echo off
call grasspile quine-base.ml -P 1000000 >quine-base.grass
if ERRORLEVEL 1 (
echo compile failed [exitcode=%ERRORLEVEL%]
exit /b 1
)
ruby mkquine.rb >quine.grass
@youz
youz / grass.ml
Last active October 12, 2022 08:42 — forked from ytomino/grass.ml
ocaml implementation of http://www.blue.sky.or.jp/grass/
View grass.ml
type token = T_w | T_W | T_v | EOF;;
let rec scan s i = (
let length = String.length s in
if i >= length then length, EOF else
match s.[i] with
| 'W' -> i + 1, T_W
| 'w' -> i + 1, T_w
| 'v' -> i + 1, T_v
| '\xef' -> (* W : EF BC B7, v : EF BD 96, w : EF BD 97 *)
@youz
youz / cookpad-puzzles-2022.rb
Last active September 13, 2022 03:25
Cookpad Code Puzzle for RubyKaigi 2022 solutions
View cookpad-puzzles-2022.rb
# https://ruby-puzzles-2022.cookpad.tech/
def answer1(n)
n+1
end
def answer2(str)
@youz
youz / Makefile
Created September 11, 2022 13:14
libm, openlibmのpowとmpfr_powを比較
View Makefile
CC = gcc
CFLAGS = -Wall -Wextra -std=gnu11 -O0
LIBS = -lmpfr -lgmp
SRC = pow.c
LIBMBIN = pow_m
OPENLIBMBIN = pow_o
all: $(LIBMBIN) $(OPENLIBMBIN)
$(LIBMBIN): $(SRC)