Skip to content

Instantly share code, notes, and snippets.

@alcidesfp
Created December 27, 2012 06:12
Show Gist options
  • Save alcidesfp/4385871 to your computer and use it in GitHub Desktop.
Save alcidesfp/4385871 to your computer and use it in GitHub Desktop.
Arbolito de Navidad
(cond-expand (chicken (use srfi-1 srfi-13))
(kawa (require 'srfi-1 'srfi-13)))
(let* ((numeros (filter odd? (iota 20 1)))
(maxnum (apply max numeros)))
(newline)
(for-each (lambda (n)
(format #t "~a~a~%" (make-string (/ (- maxnum n) 2) #\space)
(make-string n #\*)))
numeros)
(do ((i 1 (+ i 1)))
((> i 2) (format #t "¡Feliz Navidad y próspero año nuevo 2013!~%"))
(format #t "~a*~%" (make-string (/ (- maxnum 1) 2) #\space)) ))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment