The Twelve Days of Christmas: Difference between revisions

no edit summary
(Add EasyLang)
No edit summary
Line 5,654:
Two turtle doves and
A partridge in a pear tree.</pre>
 
=={{header|SparForte}}==
As a structured script.
<syntaxhighlight lang="ada">#!/usr/local/bin/spar
pragma annotate( summary, "twelve_days" )
@( description, "Write a program that outputs the lyrics of the " )
@( description, "Christmas carol The Twelve Days of Christmas. " )
@( see_also, "http://rosettacode.org/wiki/The_Twelve_Days_of_Christmas" );
pragma annotate( author, "Ken O. Burtch" );
pragma license( unrestricted );
 
pragma restriction( no_external_commands );
 
procedure twelve_days is
type days is ( first, second, third, forth, fifth, sixth,seventh, eighth,
ninth, tenth, eleventh, twelfth );
gifts : array( first..twelfth ) of string := (
" A partridge in a pear-tree.",
" Two turtle doves",
" 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"
);
begin
for day in first..twelfth loop
put( "On the " ) @ ( day ) @ ( " day of Christmas," );
new_line;
put_line( "My true love gave to me:" );
for subday in reverse first..day loop
put_line( gifts( subday ) );
end loop;
if day = first then
gifts( day ) := strings.replace_slice( gifts( day ), 2, 2, "And a" );
end if;
new_line;
end loop;
command_line.set_exit_status( 0 );
end twelve_days;
</syntaxhighlight>
 
=={{header|SQL}}==
76

edits