scheme

水差し問題

●8 リットルと 5 リットルの容器で 4 リットルの水をはかる http://www.geocities.jp/m_hiroi/puzzle/water_jug.html (use srfi-1) (define *capacity-1* 8) (define *capacity-2* 5) (define *target* 4) (define *tried* (make-hash-table 'equal?)) (defi…

Gauche でコマンドラインからエントリポイントを指定する

…ためのオプションってないのかな? $ gosh --start hoge hello.scmとすると main でなく hoge から実行が始まるような。 とりあえず↓で代用しているけど。 (define (hoge) (print "hoge world!!!")) (define (main args) (if (not (null? (cdr args))) (eval…

Gauche でファイルを実行した後 REPL ループに入る

$ gosh -I. -l asd.scm