73
4
According to this XKCD comic, there is a formula to determine whether or not the age gap in a relationship is "creepy". This formula is defined as:
(Age/2) + 7
being the minimum age of people you can date.
Therefore a relationship is creepy if either of the people in said relationship are younger than the minimum age of the other.
Given the age of two people, can you output whether or not that relationship is creepy?
Rules
Your program should take two integers as input, the age of both people in the relationship. These can be taken in any reasonable format.
Your program must then output a truthy or falsy value describiing whether or not the relationship is "creepy" (Truthy = Creepy).
- Standard loopholes are not allowed.
- This puzzle is Code Golf, so the answer with the shortest source code in bytes wins
Test Cases
40, 40 - Not Creepy
18, 21 - Not Creepy
80, 32 - Creepy
15, 50 - Creepy
47, 10000 - Creepy
37, 38 - Not Creepy
22, 18 - Not Creepy
3How should
age/2
be rounded? Probably up if the exact half is supposed to be the minimum?17,21
would make a good test case. – Martin Ender – 2017-05-24T18:20:04.5274@MartinEnder The value is a minimum, so do not round at all. It doesn't have to be an integer. – Leo – 2017-05-24T18:24:09.443
1@FishProHD can we require a certain input order (i.e. largest first) – Stephen – 2017-05-24T18:32:27.177
81You could also add
13, 13 - Creepy
. – Greg Martin – 2017-05-24T19:20:00.7601247, 10000 is an... interesting combination. I would also like to point out that according to this formula, it is creepy for Doctor Who to date any human. – David Conrad – 2017-05-26T15:01:33.853
8@DavidConrad - well yeah. its basically beastiality on his part.... – Batman – 2017-05-26T16:47:47.627
I hate to be a puritan about it but 17-20 is very-easily creepy. – Erik Reppen – 2017-05-27T05:53:03.213
Would you mind updating the accepted answer? – Okx – 2017-06-03T10:04:04.953
Done! Sorry about the delay didn't check it in a while. – Leo – 2017-06-03T10:07:24.480
An important test case is, for example,
21, 29 - Creepy
. If you do integer division you get it wrong. – Max – 2017-10-13T17:16:56.7371This post is like 5 months old @Max – Leo – 2017-10-13T17:18:08.840
Had to take a second look after seeing the title to make sure I wasn't on IPS... – FlipTack – 2017-11-20T18:18:49.503