2006-05-31から1日間の記事一覧

パスカルの三角形を OCaml で

OCaml で書いてみようとふと思い立ったのですが、二番煎じっぽいものしかできませんでした……。 let rec next_pascal_sub ls ld x = match ls with [] -> x :: ld | hd :: tl -> next_pascal_sub tl ((x + hd) :: ld) hd;; let next_pascal l = next_pascal_s…