Comment detail

ピラミッドを作る (Nested Flatten)
Gaucheで。
1
2
3
4
5
6
(define (pyramid h)
  (let loop ((space (- h 1)) (star 1))
    (if (<= 0 space)
        (begin
          (print #`",(make-string space #\\space),(make-string star #\\*)")
          (loop (- space 1) (+ star 2))))))

Index

Feed

Other

Link

Pathtraq

loading...