generated from lighthouse-labs/whats-for-lunch
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lunch.js
39 lines (32 loc) · 1.29 KB
/
lunch.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* Modify the contents of the function below, such that:
*
* If we're not hungry, we want to tell ourselves to get back to work.
* Otherwise, we want to pick something up and eat it in the lab when
* we've got less than 20 minutes or to try a place nearby if we've
* got between 20 and 30 minutes. If we have any more time than that,
* we want to remind ourselves that we're in a bootcamp and that we
* should reconsider how much time we actually have to spare.
*
* hungry is a Boolean, representing if you're hungry or not.
* availableTime is a Number representing the time you have for lunch,
* in minutes.
*/
const whatToDoForLunch = function(hungry, availableTime) {
console.log("I don't know what to do!");
}
/*
* This is some test runner code that's simply calling our whatToDoForLunch function
* defined above to verify we're making the right decisions. Do not modify it!
*/
console.log("I'm hungry and I have 20 minutes for lunch.");
whatToDoForLunch(true, 20);
console.log("---");
console.log("I'm hungry and I have 50 minutes for lunch.");
whatToDoForLunch(true, 50);
console.log("---");
console.log("I'm not hungry and I have 30 minutes for lunch.");
whatToDoForLunch(false, 30);
console.log("---");
console.log("I'm hungry and I have 15 minutes for lunch.");
whatToDoForLunch(true, 15);