Introduction

Ever heard of Remind? No? Neither did I until about 2 years ago. Basic premise of it is for teachers to send out reminders and communicate with their students. Pretty neat, right? It even allows you send emotes and react to messages! Which I do on a daily basis.

But, one thing about Remind is that the teachers always send the "Do your homework!" "If you don't, you'll get an F!". But, there is useful stuff too, like "Test on Tuesday", or the occasional "Have a good day!". I almost always reply happy with a thumbs up, but sometimes, I have to put a thumbs down.

Challenge

Your task today is to find out if a message has a certain connotation to it. If it has a positive connotation to it, reply with a thumbs up. If it has a negative connotation, reply with a thumbs down.

How am I supposed to detect connotations?

A positive connotation will normally have 3 words in it. The 3 words are: Happy, Good, and Passed.

A negative connotation will have 3 also. Those 3: Test, Fail, and Homework.

What am I testing for?

You are testing to see if a message contains positive, negative or both connotations.

If a message has positive connotations to it, go ahead and return the unicode code point for thumbs up (U+1F44D).

If it has negative connotations to it, return the unicode code point for thumbs down (U+1F44E).

If the message has both negative and positive connotations, return the code point for a neutral face (U+1F610).

If, for some other reason, it doesn't have either connotations, return a nice ol' shrug (¯\_(ツ)_/¯). If the shrug doesn't show up right, here's the Emojipedia link to the shrug

Constraints

• Program must take a message as input.
• Positive connotations must return thumbs up code point (U+1F44D)
• Negative connotations must return thumbs down code point (U+1F44E).
• If the message has both connotations, return the neutral face code point (U+1F610).
• If the message has neither connotations, return the shrug (¯\_(ツ)_/¯).
• This is , Shortest bytes win

Test cases.

Input -> Output
Happy Good Friday! -> U+1F44D
Congrats, you just played yourself -> ¯\_(ツ)_/¯
You failed the test. -> U+1F44E
Good job on the test. -> U+1F610

• You need to escape it – Rod May 26 '17 at 17:43
• it's fine, the test case has the full shrug – KuanHulio May 26 '17 at 17:43
• "If the message has both connotations, return the neutral face code point (U+1F610)." And no, not case sensitive. – KuanHulio May 26 '17 at 17:47
• To clarify: if the string contains both types of words, return neutral, regardless of if there is more of one type than the other? – Shaggy May 26 '17 at 17:56
• @Shaggy yes, just return neutral – KuanHulio May 26 '17 at 17:57

Python 3, 182166159 151 bytes

c=input().lower().count
print((["¯\_(ツ)_/¯"]+list("👍👎😐"))[any(map(c,["good","happy","passed"]))+any(map(c,["fail","test","homework"]))*2])


Try it online!

• you can insert both anys inside the print : d[any(<positive>)+any(<negative>)*2] – Rod May 26 '17 at 17:45
• I get 182 UTF-8 bytes instead of 169 – Cows quack May 26 '17 at 17:45
• utf always makes me forget extra bytes, I usually just use python's len() function on my code. Will edit – Martmists May 26 '17 at 17:47
• "👍👎😐" works fine for me. what version of python are you on? – Martmists May 26 '17 at 17:54
• I haven't tested it, but I think you could do print(d[("good"in m or"happy"in m or"passed"in m)+("bad"in m or"test"in m or"homework"in m)*2]) instead – DJMcMayhem May 26 '17 at 17:57

JavaScript, UTF-8 encoded, 100 bytes

s=>['¯\_(ツ)_/¯',...'👎👍😐'][2*/happy|good|passed/i.test(s)+/test|fail|homework/i.test(s)]


Test cases:

const a =
s=>['¯\_(ツ)_/¯',...'👎👍😐'][2*/happy|good|passed/i.test(s)+/test|fail|homework/i.test(s)]

console.log(a('Happy Good Friday!'));
console.log(a('Congrats, you just played yourself'));
console.log(a('You failed the test.'));
console.log(a('Good job on the test.'));

"$($s=Read-host;"$s ->";$1=("Test","Fail","Homework"|?{$s-match$_});$2=("Happy","Good","Passed"|?{$s-match$_});if($1-and$2){"😐"}elseif($1){"👎"}elseif($2){"👍"}else{"¯\_(ツ)_/¯"})"  Displays the input and output next to eachother. Happy Good Friday! -> 👍 Congrats, you just played yourself -> ¯\_(ツ)_/¯ You failed the test. -> 👎 Good job on the test. -> 😐 PowerShell, 187 bytes read-host|%{$s=$_;$f=0;0..5|?{$s.indexof((-split'Happy Good Passed Test Fail Homework')[$_],0,$s.length,3)+1}|%{$f=$f-bor(1,2)[$_/3]};$s+' -> '+('¯\_(ツ)_/¯','👍','👎','😐')[$f]}