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 cadr (lambda (obj) (car (cdr obj)))) | |
(define cddr (lambda (obj) (cdr (cdr obj)))) | |
(define caddr (lambda (obj) (car (cddr obj)))) | |
(define cdddr (lambda (obj) (cdr (cddr obj)))) | |
(define map | |
(lambda (f lst) | |
(if (null? lst) | |
'() | |
(cons (f (car 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
(define n-0 '(L (L (V 0)))) | |
(define n-1 '(L (L (A (V 1) (V 0))))) | |
(define n-2 '(L (L (A (V 1) (A (V 1) (V 0)))))) | |
(define n-3 '(L (L (A (V 1) (A (V 1) (A (V 1) (V 0))))))) |
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 n-0 '(L (L (V 0)))) | |
(define n-1 '(L (L (A (V 1) (V 0))))) | |
(define n-2 '(L (L (A (V 1) (A (V 1) (V 0)))))) | |
(define n-3 '(L (L (A (V 1) (A (V 1) (A (V 1) (V 0))))))) | |
(define (unwrap n) (cadr (cadr n))) |
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
;--------------------------------------------------------------- | |
; debug print | |
(define (show-recursion1 f) | |
(let ([*nest* 0]) | |
(lambda (arg) | |
(dotimes (i *nest*) (display " ")) | |
(print arg) | |
(set! *nest* (+ *nest* 1)) | |
(let ([result (f arg)]) |
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
;--------------------------------------------------------------- | |
; debug print | |
(define (show-recursion1 f) | |
(let ([nest 0]) | |
(lambda (arg) | |
(dotimes (i nest) (display " ")) | |
(print arg) | |
(set! nest (+ nest 1)) | |
(let ([result (f arg)]) |
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/env gosh | |
(define (usage) | |
(format (current-error-port) | |
"Usage: ~a [source file]\n" *program-name*) | |
(exit 2)) | |
(define s | |
(lambda (x) (lambda (y) (lambda (z) ((x z) (y z)))))) |
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
(global-set-key "\C-h" 'delete-backward-char) | |
(tool-bar-mode 0) | |
(show-paren-mode 1) | |
(menu-bar-mode 0) | |
(set-scroll-bar-mode 'right) | |
(setq column-number-mode t) | |
(setq make-backup-files nil) | |
(setq auto-save-default nil) | |
(setq x-select-enable-clipboard t) | |
(setq inhibit-startup-message t) |
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
# | |
# ~/.bashrc | |
# | |
# If not running interactively, don't do anything | |
[[ $- != *i* ]] && return | |
if [ "$PS1" ]; then | |
complete -cf sudo | |
fi |
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
/* | |
@utatakiyoshi: 友達がSkypeで「0~9を1回ずつ使い,?????/?????=1/9となるように?を埋めよ」って算数パズルを出してきたからC++でサクッと書いてドヤ顔してやった | |
ちなみにこうなった | |
result: 6381 57429 | |
result: 6471 58239 | |
result: 8361 75249 | |
result: 10638 95742 | |
result: 10647 95823 | |
result: 10836 97524 |
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
import java.util.Scanner; | |
class Mygame { | |
public static void main(String[] args) { | |
Scanner sc = new Scanner(System.in); | |
System.out.println("じゃんけんしましょー。ぱーなら0 ぐーなら1 ちょきなら2 を入力して: "); | |
int a = sc.nextInt(); | |
int b = (int)(Math.random()*3); | |
sc.nextLine(); |