Last active
April 6, 2022 07:27
-
-
Save upbeta01/a1e94c1e565fba66f6bb56968de97725 to your computer and use it in GitHub Desktop.
Revisions
-
upbeta01 revised this gist
Apr 6, 2022 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,4 @@ // File: main.rs fn main() { // This code prints the lyrics of the song: "The Twelve Days of Christmas" // Sing with me with these lines of code! -
upbeta01 created this gist
Apr 6, 2022 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,31 @@ fn main() { // This code prints the lyrics of the song: "The Twelve Days of Christmas" // Sing with me with these lines of code! let mut count = 0; let mut item_checkout: Vec<&str> = Vec::new(); let days: [&str; 12] = [ "1st", "2nd", "3rd", "4th", "5th", "6th", "7th", "8th", "9th", "10th", "11th", "12th", ]; let items: [&str; 12] = [ "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", ]; for day in days { item_checkout.insert(0, items[count]); count += 1; println!("In the {} of Christmas, my true love sent to me..", day); println!("\t{:?} \n", item_checkout); } }