solution.rkt 287 B

1234567891011121314
  1. #lang racket
  2. ;; https://www.codewars.com/kata/515f51d438015969f7000013
  3. (provide pyramid)
  4. (define (pyramid n)
  5. (define (loop ret level cur)
  6. (define next (cons 1 cur))
  7. (if (= level n)
  8. (reverse ret)
  9. (loop (cons next ret) (+ level 1) next)))
  10. (loop '() 0 '()))