In this challenge, submissions will be programs or function which, when given an emoticon such as :-)
, :(
, or :D
, will rate their happiness from 0 to 3.
An emoticon will be one of the following:
:(
: 0:|
: 1:)
: 2:D
: 3
Emoticons may also have noses (a -
after the :
).
Test cases:
:( -> 0
:-| -> 1
:D -> 3
:-) -> 2
:| -> 1
This is a code golf challenge, shortest answer per language wins.
(:
? \$\endgroup\$D:
? \$\endgroup\$:-{D
(someone with a mustache) or:-{D>
(someone with a mustache and goatee) or:-{D}
(someone with a mustache and beard). For a full list see marshall.freeshell.org/smileys.html \$\endgroup\$