How to resolve the algorithm The Twelve Days of Christmas step by step in the MiniScript programming language

Published on 12 May 2024 09:40 PM

How to resolve the algorithm The Twelve Days of Christmas step by step in the MiniScript programming language

Table of Contents

Problem Statement

Write a program that outputs the lyrics of the Christmas carol The Twelve Days of Christmas. The lyrics can be found here.
(You must reproduce the words in the correct order, but case, format, and punctuation are left to your discretion.)

Let's start with the solution:

Step by Step solution about How to resolve the algorithm The Twelve Days of Christmas step by step in the MiniScript programming language

Source code in the miniscript programming language

days = ["first","second","third", "fourth","fifth","sixth",
        "seventh","eigth","nineth","tenth","eleventh","twelfth"]
gifts = ["A partridge in a pear tree.","Two turtle doves, and",
        "Three French hens,","Four calling birds,",
        "Five gold 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,"]

for i in range(0,11)
    print "On the " + days[i] + " day of Christmas,"
    print "my true love gave to me,"
    for j in range(i,0)
        print " " + gifts[j]
    end for
    print "     ----------"
end for


  

You may also check:How to resolve the algorithm Map range step by step in the Go programming language
You may also check:How to resolve the algorithm String length step by step in the 8086 Assembly programming language
You may also check:How to resolve the algorithm Symmetric difference step by step in the Racket programming language
You may also check:How to resolve the algorithm Walk a directory/Non-recursively step by step in the Icon and Unicon programming language
You may also check:How to resolve the algorithm Sum multiples of 3 and 5 step by step in the PureBasic programming language