Basic Logic
7 JavaScript basic logic challenges, each with test cases you can run in the browser.
- sleepIn — Easy. The weekday variable indicates whether it's a weekday (true) or not (false), and the vacation variable signifies if we are on vacation (true
- deerTrouble — Easy. You're at the zoo. If both deer are smiling or neither is smiling, you're safe. But if one is smiling and the other isn't, trouble is brewin
- sumDouble — Easy. Given two int values, return their sum. Unless the two values are the same, then return double their sum.
- monkeyTrouble — Easy. We have two monkeys, a and b, and the parameters aSmile and bSmile indicate if each is smiling. We are in trouble if they are both smiling o
- parrotTrouble — Easy. We have a loud talking parrot. The 'hour' parameter is the current hour time in the range 0..23. We are in trouble if the parrot is talking
- makes10 — Easy. Given 2 ints, a and b, return true if one of them is 10 or if their sum is 10.
- nearHundred — Easy. Given an int n, return true if it is within 10 of 100 (i.e., 90 <= n <= 110) or within 10 of 200 (i.e., 190 <= n <= 210).