[challenge] code, eat and sleep - but planned! 💤💤💤💤💻💻🍴🍴🍴 | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 9

[challenge] code, eat and sleep - but planned! 💤💤💤💤💻💻🍴🍴🍴

We all know, we cant do all things immediately. We have to plan. Define three functions(code,eat,sleep) with parameter hours. Assign a priority to each function. If you call that functions, they should not be processed immediatly but scheduled. The call of a further function doit() tells the functions to run as they are scheduled: Use your own rule for schedule. Example: Rule: Highest prio first. Prios: code():1 eat():2 sleep():3 call code(1) call sleep(2) call eat(1) call code(2) call eat(2) call doit() Output: code 1 hour code 2 hours eat 1 hour eat 2 hours sleep 2 hours choose your own weapon, your own rule, your own prios Have fun

19th Jan 2018, 1:39 PM
Oma Falk
Oma Falk - avatar
6 Answers
+ 9
My try.. very late! Thank you! I really enjoyed doing this one! https://code.sololearn.com/cj9b1FbHLhxp/?ref=app
2nd Feb 2018, 7:11 AM
AZTECCO
AZTECCO - avatar
+ 6
https://code.sololearn.com/WcIapOO6qj41/?ref=app
20th Jan 2018, 8:03 AM
Michael Simnitt
Michael Simnitt - avatar
+ 5
Ty, your challenge suggestion just offered a great idea for my current task manager project.
19th Jan 2018, 8:13 PM
Michael Simnitt
Michael Simnitt - avatar
+ 3
https://code.sololearn.com/chKDvGrIB3TU/?ref=app My try. Doesn't read input exactly the way as proposed though. Kindly let me know if it is must to add 'call' to the inputs as well, or if my version will be accepted.
19th Jan 2018, 2:51 PM
Kinshuk Vasisht
Kinshuk Vasisht - avatar
+ 2
@Oma Falk Can you please notify me whether the code ran now or not? If possible, that is...
20th Jan 2018, 3:28 AM
Kinshuk Vasisht
Kinshuk Vasisht - avatar