Navigation Menu

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 / grass.ml
Last active October 12, 2022 08:42 — forked from ytomino/grass.ml
ocaml implementation of http://www.blue.sky.or.jp/grass/
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 / shecomma.lisp
Last active July 6, 2017 07:59 — forked from snmsts/shecomma.lisp
#,
(defun shecomma-reader (stream sub-character n)
(declare (ignore sub-character))
(let ((a (gensym "A"))
(f (read stream nil nil)))
`(lambda (&rest ,a)
(apply ,(case n
(0 `(quote ,f))
(1 f)
(t `(function ,f)))
,a))))
@youz
youz / filter.rb
Last active August 29, 2015 13:57 — forked from melborne/filter.rb
class Filter
class << self
def filters
@filters ||= {}
end
def add(name, &code)
filters[name] = code
end
end
@youz
youz / flippy.l
Last active December 12, 2015 03:09 — forked from kosh04/flippy.l
英数字を180度回転して表示するプログラム #xyzzy
;;; -*- Mode: Lisp; Encoding: Shift_JIS -*-
;;; 英数字を180度回転した文字を表示するプログラム
;;; 元ネタ: http://id.fnshr.info/2013/01/25/upsidedowntext/
(provide "flippy")
(in-package "user")
(defvar *flippy-alist* nil)
@youz
youz / haiyore.lisp
Created April 19, 2012 01:41 — forked from kosh04/gist:2412049
#xyzzyで這いよれ!ニャル子さんのアレ timer版 (bpmてきとう)
(provide "haiyore")
(defpackage :haiyore
(:use :lisp :editor))
(in-package :haiyore)
(defvar *timer* nil)
(defvar *mlf* nil)
;; youz's solution to Analyze a Tic-Tac-Toe Board
;; https://4clojure.com/problem/73
;;; inspired by https://gist.github.com/1024984
(fn [a x b]
(ffirst
(remove #(or (some #{:e} %) (a not= %))
`(~@b ~@(a map list b) ~(x b [0 1 2]) ~(x b [2 1 0])))))
apply #(map get % %2)