-9
\$\begingroup\$

You are trying to guess my emotion.

I will give you an adjective, as the input to the function/program.

Your task is to output the state of my eyes, either O_O for open, or ._. for closed.

Details

For these adjectives, you must output open eyes O_O

animated
breezy
brisk
driving
enterprising
fresh
indefatigable
industrious
snappy
spirited
sprightly
spry
stalwart
strenuous
strong
sturdy
unflagging
untiring

For these adjectives, you must output closed eyes ._.

beat
bored
collapsing
consumed
distressed
empty
fagged
faint
fatigued
finished
jaded
wasted
worn

Other adjectives are undefined. You may output whatever you want for other adjectives.

Specs

  • All in lowercase. All matches regex ^[a-z]+$.

Scoring

This is . Shortest solution in bytes wins.

Tips

There is a trick. The adjectives that correspond to closed eyes are all related to "tired". The adjectives that correspond to open eyes are all related to "active".

\$\endgroup\$
  • 5
    \$\begingroup\$ Why did you post 2 of pretty much the same challenges? \$\endgroup\$ – R. Kap May 1 '16 at 17:15
  • 2
    \$\begingroup\$ Closed eyes would probably be better as -_-. \$\endgroup\$ – R. Kap May 1 '16 at 17:18
  • 2
    \$\begingroup\$ @KennyLau repeating the same idea in several challenges doesnt sound exciting from the second bit, try to use them as puzzles. \$\endgroup\$ – Abr001am May 1 '16 at 17:24
  • 2
    \$\begingroup\$ Possible duplicate of Minecraft Mirrored \$\endgroup\$ – Mego May 1 '16 at 18:53
  • 1
    \$\begingroup\$ @Mego Ummm... How? \$\endgroup\$ – ericw31415 May 1 '16 at 19:59
3
\$\begingroup\$

CJam, 17 bytes

q1=1^'n>".O"='_1$

Second letters. This would have been much more fun without any "tricks" in the test cases :/

Try it online.

\$\endgroup\$
2
\$\begingroup\$

JavaScript, 151 123 113 54 50 47 45 bytes

a=>["beat","bored","collapsing","consumed","distressed","empty","fagged","faint","fatigued","finished","jaded","wasted","worn"].includes(a)?"._.":"O_O"

Long, but it's a good start.

a=>/(beat|bored|collapsing|consumed|distressed|empty|fagged|faint|fatigued|finished|jaded|wasted|worn)/.test(a)?"._.":"O_O"

Still pretty long.

a=>(/beat|(bor|consum|distress|finish|jad|wast)ed|collapsing|empty|fa(gged|int|tigued)|worn/).test(a)?"._.":"O_O"

Eliminated some redundancy.

a=>/^(be|bo|c|di|en|fa|fi|j|w)\w+/.test(a)?"._.":"O_O"

Shorter.

a=>/^(a|br|dr|en|fr|i|s|u)\w+/.test(a)?"O_O":"._."

Switched to the other(even shorter) regex for open eyes, instead of closed ones.

a=>/^(a|br|dr|en|fr|i|s|u)/.test(a)?"O_O":"._."

Better.

a=>/^(a|[bdf]r|en|i|s|u)/.test(a)?"O_O":"._."
\$\endgroup\$
1
\$\begingroup\$

MATL, 22 16 bytes

2)2\?'._.'}'O_O'

Try it online

22 byte version, 2)'ntpr'=a?'O_O'}'._.'.

\$\endgroup\$
1
\$\begingroup\$

TI-Basic, 34 bytes

"._.
If inString("nrpt",sub(Ans,2,1:"O-O
Ans

39-byte oneliner:

sub("._.O-O",1+3inString("nrpt",sub(Ans,2,1)),3
\$\endgroup\$
0
\$\begingroup\$

rs, 45 bytes

^(.*[^t]ed|[cbwef](?![rn]).*)$/._.
[^_.]+/0_0

Live demo.

\$\endgroup\$
  • \$\begingroup\$ you need four spaces to make this a code block (I can't edit because SE is bad) \$\endgroup\$ – Ven May 1 '16 at 18:19
  • \$\begingroup\$ @ven I made an edit; I just put an empty div tag at the end so I edited enough chars. \$\endgroup\$ – HyperNeutrino May 1 '16 at 18:20
  • \$\begingroup\$ @AlexL. I...uhh...edited your edit. You ended up putting the whole script on one line, but it actually is two. \$\endgroup\$ – kirbyfan64sos May 1 '16 at 18:24
  • \$\begingroup\$ @kirbyfan64sos Whoops. Okay, thanks; I don't know anything about RS. Thanks though! \$\endgroup\$ – HyperNeutrino May 1 '16 at 18:37
0
\$\begingroup\$

Python (2.x), 95 94 bytes

import re
print('O_O','._.')[len(re.findall('^a|(br)|(dr)|(en)|(fr)|i|s|u.*',raw_input()))==0]

Regex! If it starts with:
a br dr en fr i s u
then it is on the eyes-open list.

EDIT: Removed 1 byte because I didn't know how wc worked on bash. :P

\$\endgroup\$
  • \$\begingroup\$ Don't you mean em instead of en? \$\endgroup\$ – ericw31415 May 1 '16 at 19:58
  • \$\begingroup\$ @ericw31415 No; "enterprising". \$\endgroup\$ – HyperNeutrino May 1 '16 at 20:00
0
\$\begingroup\$

GameMaker Language, 72 bytes

a="._."if string_count(string_copy(argument0,2,1),"nrpt")a="O_O"return a
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.