In this challenge, you will be given an string emoticon, and your task will be to output its happiness.
An emoticon will always have eyes and mouth. It can also include eyebrows and nose. Each part will influence the overall happiness rating, which is the sum of happiness ratings of all parts. Emoticons may be flipped, reversing the order of parts. Here is the different possible parts and their happiness rating:
Symbol Flipped symbol Happiness rating Eyebrows: <None> <None> 0 < > -2 [ ] -1 | | 0 ] [ 1 > < 2 Eyes: : : 0 ; ; 1 Noses: ^ ^ 0 - - 0 Mouth < > -3 ( ) -2 [ ] -1 | | 0 ] [ 1 ) ( 2 > < 3
In Out :) 2 <:( -4 |:-| 0 >;^) 5 (; 3 >-:< -1 (:| 2
- You must be able to handle flipped emoticons. If the input can be interpreted both ways (for example <:<) you can output either of the possible results
- Standard loopholes and I/O rules apply.
- This is code-golf, so shortest code wins.