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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |
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
;; 第1回 Scheme コードバトン | |
;; | |
;; ■ これは何か? | |
;; Scheme のコードをバトンのように回していき面白い物ができあがるのを楽しむ遊びです。 | |
;; 次回 Shibuya.lisp で成果を発表します。 | |
;; Scheme 初心者のコードを書くきっかけに、中級者には他人のコードを読む機会になればと思います。 | |
;; | |
;; ■ 2 つのルール | |
;; | |
;; (1)自分がこれだと思える変更をコードに加えて2日以内に次の人にまわしてください。 |
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
#!/opt/local/bin/sbcl --script | |
;; 2009-10-06 | |
;; カプレカー操作の検算 | |
;; 4桁の場合 | |
(defparameter *num-keta* 4) | |
;;; リストをその並びの十進数に変換する | |
(defun list-to-dig (lst) | |
(reduce #'(lambda (a b) (+ (* a 10) b)) 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
digraph g{ graph[rankdir=LR;]; | |
v0477 [label="0477\n(33)"] | |
v0225 [label="0225\n(05)"] | |
v4689 [label="4689\n(25)"] | |
v1224 [label="1224\n(03)"] | |
v2268 [label="2268\n(44)"] | |
v6678 [label="6678\n(12)"] | |
v6777 [label="6777\n(01)"] | |
v5589 [label="5589\n(34)"] | |
v2889 [label="2889\n(04)"] |
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
/* find loops in kaprekar's operation sequence | |
* written by [email protected] | |
* USAGE: kaprekar <digit> | |
*/ | |
#include <stdlib.h> | |
#include <math.h> | |
#include <iostream> | |
#include <algorithm> | |
#include <map> |
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
; Googleグループ clojure-ja | |
; 質問: 関数型プログラミングでいうZip関数をClojureではどう書く? | |
; <http://groups.google.com/group/clojure-ja/browse_thread/thread/98cc4e3b7bcb4a28#> | |
; それぞれREPL実行結果まとめ | |
(def a [1 2 3 4]) | |
(def b [5 6 7 8]) | |
; はやみずさんのアイデア |
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
(ns mathew12 | |
(:use [clojure.contrib.seq-utils :only (includes? indexed)])) | |
(def m12 [0 1 2 3 4 5 6 7 8 9 10 11]) | |
; 実験 | |
(comment | |
(map (fn [m i] (vector m i)) m12 (vec (range 0 11))) | |
(indexed m12) |
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
<html> | |
<title>10分で書くベイジアンフィルタ</title> | |
<script type="text/javascript"> | |
<!--// | |
function run() { | |
var hash = splitWord(form.classA.value); | |
var str = ""; | |
var sum = 0; | |
for (key in hash) { | |
str += key + ": " + hash[key] + ";¥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
; int-calc.clj | |
(ns int-calc | |
(:use [clojure.contrib.command-line :only (with-command-line)])) | |
(with-command-line *command-line-args* | |
"clj int-calc.clj [-p|-mi|-ml] [-modulo n] nums.." | |
[[plus? p? "plus" true] | |
[minus? mi? "minus"] | |
[multiply? ml? "multiply"] | |
[modulo "mod 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
;; 順列生成アルゴリズム | |
;; 『群論の味わい』p.69より | |
(ns steinhaus | |
(:use [clojure.contrib.seq :only (rec-cat)])) | |
(defn- insert-at [item n coll] | |
(concat (take n coll) (vector item) (drop n coll))) | |
(defn stein-rec [max] |
OlderNewer