/* The Twelve Days of Christmas (Rosetta code) in Picat. http://rosettacode.org/wiki/The_Twelve_Days_of_Christmas """ Write a program that outputs the lyrics of the Christmas carol The Twelve Days of Christmas. The lyrics can be found here [http://www.lyricsmode.com/lyrics/c/christmas_carols/the_twelve_days_of_christmas.html]. (You must reproduce the words in the correct order, but case, format, and punctuation are left to your discretion.) """ This Picat model was created by Hakan Kjellerstrand, hakank@gmail.com See also my Picat page: http://www.hakank.org/picat/ */ import util. main => go. go => Days = "first second third fourth fifth sixth seventh eighth ninth tenth eleventh twelfth".split(" "), Gifts = "A partridge in a pear tree. Two turtle doves, and Three french hens, Four calling birds, Five golden rings, Six geese a-laying, Seven swans a-swimming, Eight maids a-milking, Nine ladies dancing, Ten lords a-leaping, Eleven pipers piping, Twelve drummers drumming,".split("\n"), println([to_fstring("On the %s day of Christmas,\nMy true love gave to me:\n%w\n", Day, slice(Gifts,1,D).reverse().join("\n")) : {Day,D} in zip(Days,1..length(Days))] .join("\n")), nl.