From ac489213c5440df5d07e9f3b5a074a02e3b4d3b9 Mon Sep 17 00:00:00 2001 From: toleksa Date: Mon, 12 Dec 2022 12:52:42 +0100 Subject: [PATCH 1/2] refactor sections, remove german words, rephrase tasks, change amounts to avoid calculations on floats --- Sharing_Is_Caring/Sharing_Is_Caring_Story.md | 98 ++++++-------------- 1 file changed, 28 insertions(+), 70 deletions(-) diff --git a/Sharing_Is_Caring/Sharing_Is_Caring_Story.md b/Sharing_Is_Caring/Sharing_Is_Caring_Story.md index 2a602f8..eb27462 100644 --- a/Sharing_Is_Caring/Sharing_Is_Caring_Story.md +++ b/Sharing_Is_Caring/Sharing_Is_Caring_Story.md @@ -4,13 +4,13 @@ This story is dedicated to the famous Christmas hacking taking place during adve Scene: Santa and the elves Cody, Louisa, Sleepy, Noisy, Buildy, Calcy, Singy, Sneaky and Drinky And Santa excitingly, but also slightly stressed, looks at his overly punctual, never late watch and shouts: -“Elves, let’s move it, move it, the rucksacks are finally on board, we need to depart!” +“Elves, let’s move it, move it, the backpacks are finally on board, we need to depart!” The elves happily, but also utterly exhausted, take their cushioned Christmassly decorated seats in Santa’s overloaded sleigh! Coloured presents, fir tree branches, reindeer equipments, cookies, open milk jugs, and a lot of personal traveling items are on board of this sleigh (yes, almost unbelievable, but some elves heavily exaggerated on the allowed amount of personal baggage). But Santa was courageously relaxed about this, as he knows in the end that some elves, mostly always the same ones, -exceed the allowed baggage limit also when they travel on planes! On top of the vast amount of personal belongings, each elves carries a lot a lot of sweets: 100 pieces of cookies, caramel bonbons, chocolate Christmas trees, chewing gums, candies and ginger breads each in their rucksacks. +exceed the allowed baggage limit also when they travel on planes! On top of the vast amount of personal belongings, each elves carries a lot a lot of sweets: 100 pieces of cookies, caramels, chocolate trees, chewing gums, candies and ginger breads each in their backpack. “Yeyy”, said Noisy, “we’re going on a road trip”, while heartily listening to Christmas carols on his inherited old school disc man! Excitement arises, and the elves’ hearts start beating faster, except for the really tired elves, they’re bound to fall asleep, @@ -20,51 +20,11 @@ Buildy, on the other hand, is building a wooden mini sleigh, whereas Singy is si And then there is Sneaky, who, because everyone else is doing something, decides, out of sneakishness, to take away food from Louisa’s bag. Noisy sees this, thinks to himself: “How unfair is that, so typical of Sneaky”; but then decides to also take food from other elves’ bags as well. -And the sneakishness among the elves continues. Santa isn’t so happy about that and thus wants to know two things: - -# Questions: -1) Print the highest amount of food type that each elf carries in the end. (eg. The highest amount of food type per elf). -Round the amounts of food types to full numbers. -Output should be: -- Cody = Print highest amount of food type for Cody: Either cookies or caramel bonbons or chocolate Christmas trees or chewing gums or candies or ginger breads; and the respektive amount rounded to full numbers. -- Louisa = Same procedure -- Sleepy = Same procedure -- Noisy = Same procedure -- Buildy = Same procedure -- Calcy = Same procedure -- Singy = Same procedure -- Sneaky = Same procedure -- Drinky = Same procedure - -2) Calculate the total amount of all food types per elf in the end. Print which elf has the highest amount of total food types and the respective amount. Round the amounts to full numbers. -Output should be: -- Cody = Sum of Cody's cookies and caramel bonbons and chocolate Christmas trees and chewing gums and candies and ginger breads; and the amount rounded to full numbers. -- Louisa = Same procedure -- Sleepy = Same procedure -- Noisy = Same procedure -- Buildy = Same procedure -- Calcy = Same procedure -- Singy = Same procedure -- Sneaky = Same procedure -- Drinky = Same procedure - -Print: The elf's name with the highest amount of food types and the respective amount rounded to full numbers. - -Santa, together with his elves, decides that after coding this story, they would put all their foods on the table and share. And the moral of the story is: Sharing is caring! - - - -# Take a Guess. Non-Codable Questions: -1) The story contains many (pop) cultural references to books, music, tech, etc.; what are they? -2) Before coding take a guess: Which elves do you think carries the most food pieces? +And the sneakishness among the elves continues. # Documentation: ### Sitting positions of the elves in the sleigh: -Reindeers santa reindeers - -Front of the sleigh - - Cody Louisa Sleepy - Noisy Buildy Calcy @@ -72,40 +32,38 @@ Front of the sleigh - Singy Sneaky Drinky -At the beginning each elf has 100 pieces of each food type, which are: cookies, caramel bonbons, chocolate Christmas trees, chewing gums, candies and ginger breads. +At the beginning each elf has 100 pieces of each food type, which are: cookies, caramels, chocolate trees, chewing gums, candies and ginger breads. -- Every elf having a neighbour to the right takes 2 cookies each from that neighbour, and 1/6 of the combined amount of stolen cookies gets eaten. -- Every elf having a neighbour to the left takes 5 caramel bonbons each from that neighbour, and 1/3 of the combined amount of stolen bonbons gets eaten. -- Every elf in the middle that has neighbours left and right, takes from them each 3 chocolate Christmas trees, and none get eaten. -- Every elf having an elf sitting behind them, takes 6 chewing gums each from that elf, and 1/4 of the combined amount of stolen cheewing gum gets eaten. -- Every elf having an elf sitting in front of them, takes 7 candies each from that elf, and 1/2 of the combined amount of stolen candies gets eaten. -- Every elf having an elf sitting in front and in the back of them, takes 8 ginger breads each from that elf, and 2/5 of the combined amount of stolen ginger breads gets eaten. +- Every elf having a neighbour to the right takes 2 cookies from that neighbour and eats 1/2 (half) of them. +- Every elf having a neighbour to the left takes 6 caramels from that neighbour and eats 1/3 of them +- Every elf in the middle that has neighbours left and right, takes from them each 3 chocolate trees and none get eaten. +- Every elf having an elf sitting behind them, takes 8 chewing gums from that elf and 1/4 of stolen cheewing gum gets eaten. +- Every elf having an elf sitting in front of them, takes 8 candies from that elf and 1/2 of stolen candies gets eaten. +- Every elf having an elf sitting in front and in the back of them, takes 2 ginger breads from that each of those elves and 3/4 of stolen ginger breads gets eaten. -### See example below for the Cookies: +# Take a Guess. Non-Codable Questions: +1) The story contains many (pop) cultural references to books, music, tech, etc.; what are they? +2) Before coding take a guess: Which elves do you think carries the most food pieces at the end? -- Cody takes two cookies from Lousia -- Noisy takes two cookies from Buildy -- Singy takes two Cookies from Drinky -- Louisa takes two cookies from Sleppy -- Buildy takes two cookies from Calcy -- Sneaky takes two cookies from Calcy +# Questions: +1) Find which elf has the highest amount of food at the end - print name and total amount. ---> All in all 2x6 cookies have been stolen (=12 cookies); 1/6 of this amount (= 2 cookies) gets eaten; so 10 stolen cookies remain, which are equally distributed among the cooky thieves: 10/6 = 1.66 +2) For each elf, find which type of food that elf has in highest amount - print name, food type and the amount. -In the end: -- Cody has: 100 + 2 + 1.66 cookies -- Noisy has: 100 + 2 + 1.66 cookies -- Singy has: 100 + 2 + 1.66 cookies -- Louisa has: 100 - 2 + 2 + 1.66 cookies -- Buildy has: 100 - 2 + 2 + 1.66 cookies -- Sneaky has: 100 - 2 + 2 + 1.66 cookies -- Sleepy has: 100 - 2 cookies -- Calcy has: 100 - 2 cookies -- Drinky: 100 - 2 cookies +3) Find total amount of all food elves have and check what percentage is missing compared to start of the journey - print total number and percent of missing food. -And then the next task is repeated in a similar way. +Santa, together with his elves, decides that after coding this story, they would put all their foods on the table and share. And the moral of the story is: Sharing is caring! + + +### See example below for the Cookies: + +- Cody takes two cookies from Lousia +- Cody eats half of stolen cookies +- Luisa has now 100-2=98 cookies +- Cody has 100+(2-1)=101 cookies -After a copious candy and sweets eating feast, all the elves and Santa fall contentedly asleep, as the reindeers continue the journey in the darkness of a December night, sharing and eating up the rest of the candies. +- Luisa takes two cookies from Sleepy +- Luisa has now 98+(2-1) cookies (Emilia Tech4, adapted by StoryCoder.dev under creative commons license CC BY-NC-SA 4.0 International) From 6bb4b8fee5d8afe2691ec87724d43d9c5f0f87fa Mon Sep 17 00:00:00 2001 From: toleksa Date: Mon, 12 Dec 2022 13:01:19 +0100 Subject: [PATCH 2/2] reorder --- Sharing_Is_Caring/Sharing_Is_Caring_Story.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/Sharing_Is_Caring/Sharing_Is_Caring_Story.md b/Sharing_Is_Caring/Sharing_Is_Caring_Story.md index eb27462..57ebe1d 100644 --- a/Sharing_Is_Caring/Sharing_Is_Caring_Story.md +++ b/Sharing_Is_Caring/Sharing_Is_Caring_Story.md @@ -52,10 +52,6 @@ At the beginning each elf has 100 pieces of each food type, which are: cookies, 3) Find total amount of all food elves have and check what percentage is missing compared to start of the journey - print total number and percent of missing food. - -Santa, together with his elves, decides that after coding this story, they would put all their foods on the table and share. And the moral of the story is: Sharing is caring! - - ### See example below for the Cookies: - Cody takes two cookies from Lousia @@ -66,4 +62,11 @@ Santa, together with his elves, decides that after coding this story, they would - Luisa takes two cookies from Sleepy - Luisa has now 98+(2-1) cookies + + + +Santa, together with his elves, decides that after coding this story, they would put all their foods on the table and share. And the moral of the story is: Sharing is caring! + + + (Emilia Tech4, adapted by StoryCoder.dev under creative commons license CC BY-NC-SA 4.0 International)