mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 21:59:17 +02:00
16 lines
447 B
Scheme
16 lines
447 B
Scheme
(import (scheme base)
|
|
(scheme write)
|
|
(scheme process-context)
|
|
(pingala binomial))
|
|
|
|
(let* ((args (command-line))
|
|
(rows (or (and (pair? args) (pair? (cdr args))
|
|
(string->number (cadr args)))
|
|
5)))
|
|
(do ((i 0 (+ i 1)))
|
|
((> i rows))
|
|
(do ((j 0 (+ j 1)))
|
|
((> j i) (newline))
|
|
(if (not (zero? j))
|
|
(write-char #\space))
|
|
(write (binomial i j)))))
|