Merry Christmas

Whatever is on your mind, whether Lisp related or not.

Merry Christmas

Postby sylwester » Tue Dec 25, 2012 11:08 am

Scheme version 2012
Code: Select all
(define (x-mas)
  (define (x-mas-strings tokens order)
    (if (not (null? order))
        (cons (list-ref tokens (car order)) (x-mas-strings tokens (cdr order)))
        '()))
  (apply string-append
         (x-mas-strings '("We wish you a Merry "
                          "Christmas"
                          "\n"
                          " and a Happy New year."
                          "Good tidings "
                          "we bring for you and your kind"
                          "for Christmas"
                          "Oh, bring us a figgy pudding"
                          " and a cup of good cheer."
                          "We won't go until we get some"
                          ", so bring some out here")
                        '(0 1 2
                          0 1 2
                          0 1 3 2
                          4 5 2
                          4 6 3 2 2
                          7 2
                          7 2
                          7 8 2 2
                          9 2 9 2 9 10 2))))

(display (x-mas))


Zozotez version 2011
Code: Select all
;; put this as input instead of normal driver
((\ (wewish newy gtidings bring)
(p wewish)(p wewish)(p wewish ())(p newy)
(p gtidings ())(p '|we | ())(p bring)
(p gtidings ())(p '|for Christmas| ())(p newy))
'|We wish you a Merry Christmas|
'| and a Happy New Year.|
'|Good tidings |
'|bring to you and your kind|)
I'm the author of two useless languages that uses BF as target machine.
Currently I'm planning a Scheme compiler :p
sylwester
 
Posts: 84
Joined: Mon Jul 11, 2011 2:53 pm

Return to The Lounge

Who is online

Users browsing this forum: No registered users and 1 guest

cron