Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 94477
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 10, 20262026-05-10T23:30:28+00:00 2026-05-10T23:30:28+00:00

Print all 12 verses of the popular holiday song . By 12 verses I

  • 0

Print all 12 verses of the popular holiday song.

By 12 verses I mean the repetition of each line as is sung in the song, ie

Verse One: On the first day of Christmas my true love gave to me a partridge in a pear tree.

Verse Two On the second day of Christmas my true love gave to me two turtle doves and a partridge in a pear tree.

…

Verse N: On the nth day of Christmas my true love gave to me (Verse N-1 without the first line) (line added in verse N)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-10T23:30:28+00:00Added an answer on May 10, 2026 at 11:30 pm

    Common Lisp:

    (mapc #'princ       (reverse (maplist #'(lambda(l)          (format nil              'On the ~:R day of Christmas my true love gave to me~%~{~a~%~}~%'                  (length l) l))      '('twelve drummers drumming,'       'eleven pipers piping,'       'ten lords a-leaping,'       'nine ladies dancing,'       'eight maids a-milking,'       'seven swans a-swimming,'       'six geese a-laying,'       'five gold rings,'       'four calling birds,'       'three french hens,'       'two turtle doves, and'       'a partridge in a pear tree.')))) 

    Edit:

    Above is 412 characters if you take out the whitespace.

    This one:

    (let ((g))   (dotimes (i 12)     (format t         'On the ~:R day of Christmas my true love gave to me~%~{~R ~:*~          ~[~;~;turtle doves and~;french hens,~;calling birds,~;gold rings,~          ~;geese a-laying,~;swans a-swimming,~;maids a-milking,~          ~;ladies dancing,~;lords a-leaping,~;pipers piping,~          ~;drummers drumming,~]~%~}a partridge in a pear tree~2%'         (1+ i) g)     (push (+ i 2) g))) 

    is 344 characters if you take out whitespace and ~ quoted newlines in the format string:

    (let((g))(dotimes(i 12)(format t'On the ~:R day of Christmas my true love gave to me~%~{~R ~:*~[~;~;turtle doves and~;french hens,~;calling birds,~;gold rings,~;geese a-laying,~;swans a-swimming,~;maids a-milking,~;ladies dancing,~;lords a-leaping,~;pipers piping,~;drummers drumming,~]~%~}a partridge in a pear tree~2%'(1+ i)g)(push(+ i 2)g))) 

    Edit:

    It looks like the question has run its course, and the site is nagging me to accept an answer. As far as I can see, this one is the shortest. I’m a little afraid of what the site will do if I accept my own answer – probably award me a Narcissist or Masturbator badge.

    You can’t accept your own answers. Fair enough. I’ll leave it open. Thanks to everyone who responded.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 66k
  • Answers 66k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • added an answer Regular expressions are definitely the first place most start out… May 11, 2026 at 11:37 am
  • added an answer EDIT Looking at the source code online it appears that,… May 11, 2026 at 11:37 am
  • added an answer The views should continue to work. Perhaps you have the… May 11, 2026 at 11:37 am

Related Questions

Print all 12 verses of the popular holiday song . By 12 verses I
Is there a way to print all methods of an object in JavaScript?
How can I print a plain list of all files that were part of
All of my codes fail. They should print he, hello and 5 \n 3,
All paint programs, independent of how simple or complex they are, come with a
OpenID is all good... UNTIL the provider goes down. At that point you're potentially
At what point would you create your own exception class vs. using java.lang.Exception? (All
Imagine you have a large array of floating point numbers, of all kinds of
The print functionality of Excel (using VBA) is extremely slow. I'm hoping someone has
Consider: print $foo, AAAAAAAA, $foo, BBBBBBBB; Let's say I want to use this code

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.