# Are my eyes open or closed?

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
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". • Why did you post 2 of pretty much the same challenges? – R. Kap May 1 '16 at 17:15 • Closed eyes would probably be better as -_-. – R. Kap May 1 '16 at 17:18 • @KennyLau repeating the same idea in several challenges doesnt sound exciting from the second bit, try to use them as puzzles. – Abr001am May 1 '16 at 17:24 • Possible duplicate of Minecraft Mirrored – Mego May 1 '16 at 18:53 • @Mego Ummm... How? – ericw31415 May 1 '16 at 19:59 ## 7 Answers # CJam, 17 bytes q1=1^'n>".O"='_1$


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

# JavaScript, 151123113545047 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":"._."


# MATL, 22 16 bytes

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


Try it online

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

# 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


# rs, 45 bytes

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


Live demo.

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

# 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

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

# GameMaker Language, 72 bytes

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