Sha256: 5c9b12d33b612bc179a8dc65c3cf7b3d2cb9efd1968f438dc72b5b480feb8815
Contents?: true
Size: 446 Bytes
Versions: 185
Compression:
Stored size: 446 Bytes
Contents
(defpackage #:pascal (:use #:common-lisp) (:export #:rows)) (in-package #:pascal) (defun fact (n) (loop for i from 0 to n for fact = 1 then (* fact i) finally (return fact))) (defun choose (n r) (/ (fact n) (* (fact r) (fact (- n r))))) (defun rows (n) (if (> n 0) (loop for i from 0 to (1- n) collect (loop for j from 0 to i collect (choose i j))) '()))
Version data entries
185 entries across 185 versions & 1 rubygems