How to resolve the algorithm The Twelve Days of Christmas step by step in the Vedit macro language 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 Vedit macro language 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 Vedit macro language programming language
Source code in the vedit programming language
for (#1 = 1; #1 <= 12; #1++) {
Num_Str(#1, 9, LEFT)
IT("On the ")
Call("day |@(9)")
IT(" day of Christmas, my true love sent to me:") IN
Call("gift |@(9)")
IN
}
return
:day 1: IT("first") return
:day 2: IT("second") return
:day 3: IT("third") return
:day 4: IT("fourth") return
:day 5: IT("fifth") return
:day 6: IT("sixth") return
:day 7: IT("seventh") return
:day 8: IT("eighth") return
:day 9: IT("ninth") return
:day 10: IT("tenth") return
:day 11: IT("eleventh") return
:day 12: IT("twelfth") return
:gift 12: IT("Twelve drummers drumming,") IN
:gift 11: IT("Eleven pipers piping,") IN
:gift 10: IT("Ten lords a-leaping,") IN
:gift 9: IT("Nine ladies dancing,") IN
:gift 8: IT("Eight maids a-milking,") IN
:gift 7: IT("Seven swans a-swimming,") IN
:gift 6: IT("Six geese a-laying,") IN
:gift 5: IT("Five gold rings,") IN
:gift 4: IT("Four calling birds,") IN
:gift 3: IT("Three French hens,") IN
:gift 2: IT("Two turtle doves, and") IN
:gift 1: IT("A partridge in a pear tree.") IN
return
You may also check:How to resolve the algorithm Substring step by step in the Bracmat programming language
You may also check:How to resolve the algorithm Primality by trial division step by step in the МК-61/52 programming language
You may also check:How to resolve the algorithm Ackermann function step by step in the 8086 Assembly programming language
You may also check:How to resolve the algorithm Combinations with repetitions step by step in the AutoHotkey programming language
You may also check:How to resolve the algorithm Split a character string based on change of character step by step in the Modula-2 programming language