Page 1 of 1

Merry Christmas

Posted: Tue Dec 25, 2012 11:08 am
by sylwester
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|)