This file contains 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
(function (fc){ | |
var c = fc.replace(/(.)(.)(.)(.)/, "$3っ$4っ$1っら・ら・ら・ら・$1$2$3$4、"); | |
return c+c+c+"だ・い・じ・け・ん♪"; | |
})("ゆるゆり") |
This file contains 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
(define fact (lambda (x) | |
(if (== x 0) | |
1 | |
(* x (fact (- x 1)))))) | |
(alert (fact 5)) |
This file contains 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
(define fizzbuzz (lambda (i) | |
(if (== i 101) | |
"" | |
(if (== (% i 15) 0) | |
(+ "fizzbuzz," (fizzbuzz (+ i 1))) | |
(if (== (% i 3) 0) | |
(+ "fizz," (fizzbuzz (+ i 1))) | |
(if (== (% i 5) 0) | |
(+ "buzz," (fizzbuzz (+ i 1))) | |
(+ (+ (String i) ",") (fizzbuzz (+ i 1)))) |
This file contains 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
(define fib (lambda (n) | |
(fib_in n 0 1))) | |
(define fib_in (lambda (n p1 p2) | |
(if (== n 0) | |
p1 | |
(fib_in (- n 1) (+ p1 p2) p1)))) | |
(define fibbuzz (lambda (n) | |
(if (>= (= a (fib n)) 1000) | |
(String a) |
This file contains 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
(define swap (lambda (a b lis) | |
((. (vector) concat) | |
((. lis slice) 0 a) | |
(get lis b) | |
(get lis a) | |
((. lis slice) (+ b 1))))) | |
(define gnomesort (lambda (lis i) | |
(if (>= i (. lis length)) | |
lis |
This file contains 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
;汚い。気にしない。 | |
(define Z (lambda (f) ((lambda (p) | |
(f (lambda (a) ((p p) a)))) | |
(lambda (p) | |
(f (lambda (a) ((p p) a))))))) | |
(define sake (lambda (f) | |
(lambda (n) | |
(if (> n 12) |
This file contains 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
M-x term | |
nethack | |
M-x load-file | |
/path/to/nethackinTwitterer.el |
This file contains 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
#!/usr/bin/python | |
import re | |
class Unbound: pass | |
###utilities### | |
def car(lst): | |
return lst[0] | |
def cdr(lst): | |
return lst[1:len(lst)] |
This file contains 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
var prevpos = 0; //一つ前の状態を管理 | |
var negaeri = function(e){ | |
var x; | |
if (Math.abs((x = Math.floor(e.accelerationIncludingGravity.x)) - prevpos) > 5) | |
{ | |
if ((prevpos < 0 && x < 0) || (prevpos > 0 && x > 0)) return; | |
var stat = (x > -2 && x < 2) ? "上を向いたようです" : (x < prevpos) ? "右に寝返りをうったようです" : "左に寝返りをうったようです"; | |
prevpos = x; | |
var d = new Date(); | |
var tweet = d.getHours() + "時" + d.getMinutes() + "分" + d.getSeconds() + "秒に" + stat + " #negaeri"; |
This file contains 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
(define forrange (lambda (i to fn) | |
(if (>= (+ i 1) to) | |
(fn i) | |
(begin (fn i) | |
((. arguments callee) (+ i 1) to fn))))) | |
(= (. Object prototype get) | |
(lambda (attr) (get this attr))) | |
(= (. Number prototype foreach) |
OlderNewer