16
\$\begingroup\$

Note: SmokeDetector is a bot that detects spam and offensive posts on the network and posts alerts to chat.

What to implement

Smokey's !!/alive command uniformly at random picks one of these messages:

  • Yup
  • You doubt me?
  • Of course
  • ... did I miss something?
  • plz send teh coffee
  • Watching this endless list of new questions never gets boring
  • Kinda sorta
  • You should totally drop that and use jQuery
  • ¯\_(ツ)_/¯
  • ... good question

and prints it to the screen.

Your task is to implement that command.

Rules

Regular code-golf — the shortest answer in bytes wins ;)

Good luck!

\$\endgroup\$
5
  • 5
    \$\begingroup\$ Does the italic "never" in the 6th response do anything with our programs? \$\endgroup\$
    – SunnyMoon
    Oct 24 '20 at 20:48
  • 2
    \$\begingroup\$ Please clarify what you mean by "yes"; what is our program supposed to output in terms of italics? \$\endgroup\$
    – hyper-neutrino
    Oct 26 '20 at 0:48
  • \$\begingroup\$ @HyperNeutrino sorry, I meant contrary: nothing. \$\endgroup\$ Oct 26 '20 at 13:02
  • \$\begingroup\$ Is it supposed to take !!/alive as input? Or just do the output? \$\endgroup\$
    – Xcali
    Dec 27 '20 at 18:21
  • \$\begingroup\$ @Xcali Just output ;) \$\endgroup\$ Dec 27 '20 at 18:31

15 Answers 15

12
\$\begingroup\$

Python 2, 240 bytes

Hexdump:

00000000: efbb bf65 7865 6322 2222 789c 3d4f 3b4e  ...exec"""x.=O;N
00000010: c430 10bd ca53 aa84 221c 8082 1a51 202a  .0...S.."....Q *
00000020: b4d2 4a6b 6f3c 498c 1c8f f18c 414b 0bf7  ..Jko<I.....AK..
00000030: d93b ec55 b808 0348 54a3 d1fb cf95 3754  .;.U...HT.....7T
00000040: 9f83 9db8 15ae 7a75 536a cc8a 69e5 3851  ......zuSj..i.8Q
00000050: dfed 5a71 f731 070f 31d4 bb1d 3704 6e47  ..Zq.1..1...7.nG
00000060: c546 b76e 1c47 8418 7087 2d8a 1865 235d  .F.n.G..p.-..e#]
00000070: 635e fe90 8539 e0a5 9168 e4ec 4a7a 8750  c^...9...h..Jz.P
00000080: 0e50 5a31 f13c 13b9 27af d30f 1fa6 1218  .PZ1.<..'.......
00000090: 98c8 6c52 1405 cfc8 f4f6 2f17 fb5e a962  ..lR....../..^.b
000000a0: 2115 1cd9 3a2e ee61 369f 5685 dce5 bc3f  !...:..a6.V....?
000000b0: f45f 1f9f c3e1 fa72 feed 282b b764 59ac  ._.....r..(+.dY.
000000c0: 3ea5 1342 e562 215e 6163 d184 f0fc d8a8  >..B.b!^ac......
000000d0: 9eba 514a 8ada 77ae 1b86 6f8b b863 c922  ..QJ..w...o..c."
000000e0: 2222 2e64 6563 6f64 6528 227a 6970 2229  "".decode("zip")

Try it online!

\$\endgroup\$
4
  • \$\begingroup\$ Impressed, you used a ASCI.-HEX converter and put the HEX to test.hex? Can you outline what and how you did it (maybe you used a tool)? \$\endgroup\$
    – Timo
    Oct 25 '20 at 11:09
  • 8
    \$\begingroup\$ PYTHON ????????? \$\endgroup\$ Oct 25 '20 at 13:44
  • \$\begingroup\$ It should be “plz send teh coffee”, not “please ...” according to the question \$\endgroup\$ Oct 25 '20 at 23:13
  • \$\begingroup\$ Thanks @cairdcoinheringaahing for letting me know. That's what I get for filching the list from another answer. Should be fixed now. (also saves bytes!) \$\endgroup\$
    – Sisyphus
    Oct 26 '20 at 0:22
9
\$\begingroup\$

05AB1E, 123 bytes

Žmõ甡¸€îååªç€î”#`“Yup
ÿ¬³€á?
Of…£
...ƒ§ Iš§†á?
plzƒ¨ teh™²
ÿ€Œèႇ€‚€¢…醙–ÜÜÀ
ÿŠœa
ÿ‚©§À›Â€Š€ƒ€Å jÿ
¯\_(ÿ)_/¯
...‚¿†ä“¶¡Ω

Try it online!

Note: Prints a random response with a trailing newline.

Golfed using @KevinCruijssen's well known golf tip.

Explanation

Žmõç                         # Push the katakana character 'ツ'
”¡¸€îååªç€î”#`               # Push some uncompressible words onto the stack
“...“                        # Then push a compressed string containing the following contents:
  Yup                        # "Yup"
  ÿ¬³ me?                    # "You doubt me?"
  Of…£                       # "Of course"
  ...ƒ§ Iš§†á?               # "... did I miss something?"
  plzƒ¨ teh™²                # "plz send teh coffee"
  ÿ€Œèႇ€‚…醙–ÜÜÀ          # "Watching this endless list of new questions never gets boring"
  ÿŠœa                       # "Kinda sorta"
  ÿ‚©§À›Â€Š€ƒ€Å jQuery       # "You should totally drop that and use jQuery"
  ¯\_(ÿ)_/¯                  # shruggy boy
  ...‚¿†ä                    # "... good question"

¶¡                           # Split the responses into a good ol' list
Ω                            # Randomly pick a response
                             # At the end, yell the response out to STDOUT implicitly

Random fact: I was in halfway in the making of this program when my laptop crashed. I had to start coding again. Oh well, at least my answer is winning at the time of writing this!

\$\endgroup\$
6
  • 2
    \$\begingroup\$ Are the upper lines and Japanese character in the shrug emoji part of 05AB1E's byte set? If not, I think you need to count them as however many bytes 05AB1E's interpreter reads the as (your answer is still winning though!) \$\endgroup\$
    – hyper-neutrino
    Oct 26 '20 at 0:51
  • 2
    \$\begingroup\$ The compressed string for "Watching this endless list of new questions never gets boring" is actually missing the word "new". \$\endgroup\$
    – sporeball
    Oct 26 '20 at 6:17
  • \$\begingroup\$ @HyperNeutrino is indeed correct. You can fix this by changing the to ÿ, and adding a leading Žmõç. In addition, you can golf the titlecased words at the start of each sentence (and the Query). As well as change the <space>me to €á. In total including fix: 121 bytes. \$\endgroup\$ Oct 26 '20 at 7:50
  • 1
    \$\begingroup\$ Actually 123 bytes, including a fix for the missing new what @sporeball mentioned. \$\endgroup\$ Oct 26 '20 at 7:56
  • 1
    \$\begingroup\$ @SunnyMoon Except for your updated explanation. ;) \$\endgroup\$ Oct 26 '20 at 12:44
6
\$\begingroup\$

R, 265 bytes

cat(sample(c('Yup','You doubt me?','Of course','... did I miss something?','please send teh coffee','Watching this endless list of new questions never gets boring','Kinda sorta','You should totally drop that and use jQuery','¯\\_(ツ)_/¯','... good question'),1))

Try it online!

\$\endgroup\$
5
  • \$\begingroup\$ 262 bytes \$\endgroup\$ Oct 24 '20 at 21:44
  • \$\begingroup\$ The "please send teh coffee" should be "plz send teh coffee" \$\endgroup\$
    – SunnyMoon
    Oct 25 '20 at 14:51
  • \$\begingroup\$ While working on the continuation of this challenge, I noticed that readLines gives even less overhead \$\endgroup\$
    – Kirill L.
    Oct 25 '20 at 15:38
  • \$\begingroup\$ @DominicvanEssen the core of the challenge is the KC portion so you should post that yourself! \$\endgroup\$
    – Giuseppe
    Oct 26 '20 at 14:48
  • \$\begingroup\$ @KirillL. same goes to you \$\endgroup\$
    – Giuseppe
    Oct 26 '20 at 14:48
5
\$\begingroup\$

Jelly, 145 bytes

“þkċṁṚFọẏ_ỌƤ:ZfCðƓ$6ṛtẓ2JƇMɼ¤ẆƥyɼȧẒ¡ƇƘ9Ɲŀẏ®ỊH\.ƒgFĊ#Ọṁv;`Ä?ḄƒXƲeȥẹ$Ḟ-Ṿṙ"zḄfWẊkEƓẇẇṢ¶ż²ṘzḄ¢ɼQ2³{Ėṃ"B¡f÷ṅƇ0@bSḟ⁶E⁶ėẇefðRẹȤ»O_33o142+33+197¦12309ỌỴX

Try it online!

Encodes the whole string but replacing the shrug with !\_(!)_/! (since ! doesn't show up in the string and only printable ASCII / newlines are allowed), and then replaces ! with the upper bar symbol, and then just sets the Japanese character at that index manually.

Then, split by newlines and select a random one.

\$\endgroup\$
0
5
\$\begingroup\$

Pyth, 230 bytes

Oc"Yup	You doubt me?	Of course	... did I miss something?	plz send teh coffee	Watching this endless list of new questions never gets boring	Kinda sorta	You should totally drop that and use jQuery	¯\_(\u30C4)_/¯	... good question"\	

Try it online!

Fun fact: If you used a "packed" string, the byte count would jump up to 388.

\$\endgroup\$
0
4
\$\begingroup\$

Python 3, 283 274 bytes

-9 bytes thanks to ovs

from random import*
print(choice('Yup,You doubt me?,Of course,... did I miss something?,please send teh coffee,Watching this endless list of new questions never gets boring,Kinda sorta,You should totally drop that and use jQuery,¯\_(ツ)_/¯,... good question'.split(',')))

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ Save two bytes: print(choice('Yup','You doubt me?','Of course','... did I miss something?','please send teh coffee','Watching this endless list of new questions never gets boring','Kinda sorta','You should totally drop that and use jQuery','¯\_(ツ)_/¯','... good question')) \$\endgroup\$ Oct 24 '20 at 16:01
  • \$\begingroup\$ And you can save a few more bytes with 'Yup,You ... question'.split(','). \$\endgroup\$
    – ovs
    Oct 24 '20 at 18:01
4
\$\begingroup\$

JavaScript, 297 287 285 277 265 bytes

-10 bytes by replacing Math.floor() with ~~()

-2 bytes by replacing ~~() with |0 thanks to @Neil

-8 bytes by replacing array with string.split(',')

-12 bytes by placing options directly inside of alert() and replacing string.split(',') with string.split`,`

alert('Yup,You doubt me?,Of course,... did I miss something?,please send teh coffee,Watching this endless list of new questions never gets boring,Kinda sorta,You should totally drop that and use jQuery,¯\\_(ツ)_/¯,... good question'.split`,`[Math.random()*10|0])

Fiddle

\$\endgroup\$
3
  • 2
    \$\begingroup\$ I think |0 is even shorter than ~~(). \$\endgroup\$
    – Neil
    Oct 25 '20 at 10:03
  • \$\begingroup\$ @Neil I don't understand what you mean \$\endgroup\$ Oct 25 '20 at 10:06
  • 1
    \$\begingroup\$ alert(x[Math.random()*x.length|0]) \$\endgroup\$
    – Neil
    Oct 25 '20 at 10:15
3
\$\begingroup\$

K (oK), 237 bytes

`0:*1?";"\"Yup;You doubt me?;Of course;... did I miss something?;plz send teh coffee;Watching this endless list of new questions never gets boring;Kinda sorta;You should totally drop that and use jQuery;¯\\_(ツ)_/¯;... good question";

Try it online!

If returning a string is acceptable, the leading `0: and trailing ; can be elided to save 4 bytes.

\$\endgroup\$
0
3
\$\begingroup\$

Charcoal, 152 151 bytes

‽⊞O⪪”}∧Pπ↙!▶�▶τ×Blal⁰FW⊕← ″»yε⦃σ$L}⊖0!…Rf»V?⌕ΦYV'∕ⅉ)>ιη¤=▷∧p{<ψ;↶~⌊″≔↔≡m≦ζX"´j\`⁹WS⌕V›w}LV>DTY(Y⪪h‽BRV⌕↥↘⮌\L∨⁰MPφFY5^IG↑~c‖"⌕ν﹪ηVE\`êVω”A¦¯\_(ツ)_/¯

Try it online! Link is to verbose version of code. Edit: Saved 1 byte by using A as a separator. Note: The deverbosifier claims 148 147 bytes, but I believe ¯ (like ) needs to be encoded using 3 bytes in Charcoal. Explanation: Charcoal can only compress strings of printable ASCII, so the shrug is appended separately.

    ”...”               Compressed string
   ⪪     ¶              Split on newlines
 ⊞O        ¯\_(ツ)_/¯    Push literal string
‽                       Random element
                        Implicitly print
\$\endgroup\$
1
  • 2
    \$\begingroup\$ "Charcoal" is really really to the point ;D \$\endgroup\$ Oct 25 '20 at 13:43
3
\$\begingroup\$

Bash, 269 267 266 264 bytes

-2: @user42589

-1: @nthnchu

-2: @Nahuel Fouilleul

q=(Yup "You doubt me?" Of\ course "... did I miss something?" "plz send teh coffee" "Watching this endless list of new questions never gets boring" Kinda\ sorta "You should totally drop that and use jQuery" "¯\_(ツ)_/¯" "... good question");echo ${q[RANDOM%10]}

Try it online!

\$\endgroup\$
2
  • \$\begingroup\$ The quotes around "Yup" can be removed, saving 2 bytes. \$\endgroup\$ Oct 25 '20 at 16:56
  • \$\begingroup\$ 264 bytes \$\endgroup\$ Oct 25 '20 at 19:35
2
\$\begingroup\$

C (gcc), 294 290 289 bytes

Saved 4 bytes thanks to ErikF!!!
Saved a byte thanks to ceilingcat!!!

*s[]={"Yup","You doubt me?","Of course","... did I miss something?","please send teh coffee","Watching this endless list of new questions never gets boring","Kinda sorta","You should totally drop that and use jQuery","¯\\_(ツ)_/¯","... good question"};f(){puts(s[rand(srand(time(0)))%10]);}

Try it online!

Straightforward rand() selection from an array of strings.

\$\endgroup\$
5
  • 4
    \$\begingroup\$ @VictorVosMottor You should refrain from spamming everyone with links to your newest challenge, we can all see them on the Questions page. \$\endgroup\$
    – Noodle9
    Oct 25 '20 at 14:22
  • \$\begingroup\$ ok. I just thought they would find the new question interesting too ;) Didn't mean any spamming. \$\endgroup\$ Oct 25 '20 at 14:24
  • \$\begingroup\$ @VictorVosMottor It lights up our comment box and that's usually not someone telling us about a new challenge they've posted. \$\endgroup\$
    – Noodle9
    Oct 25 '20 at 14:26
  • \$\begingroup\$ Ah, ok. But can I keep this question? \$\endgroup\$ Oct 25 '20 at 14:29
  • \$\begingroup\$ @VictorVosMottor Of course you can, deleting all those comments was the right thing to do. \$\endgroup\$
    – Noodle9
    Oct 25 '20 at 23:11
2
\$\begingroup\$

Scala, 278 267 bytes

print("Yup#You doubt me?#Of course#... did I miss something?#plz send teh coffee#Watching this endless list of new questions never gets boring#Kinda sorta#You should totally drop that and use jQuery#¯\\_(ツ)_/¯#... good question".split("#")((math.random*10)toInt))

Try it online!

\$\endgroup\$
3
  • \$\begingroup\$ 267 bytes: print("Yup#You doubt me?#Of course#... did I miss something?#plz send teh coffee#Watching this endless list of new questions never gets boring#Kinda sorta#You should totally drop that and use jQuery#¯\\_(ツ)_/¯#... good question".split('#')((math.random*10)toInt)) \$\endgroup\$
    – corvus_192
    Oct 25 '20 at 17:22
  • 1
    \$\begingroup\$ Only works in Scala 2.12 though \$\endgroup\$
    – corvus_192
    Oct 25 '20 at 17:22
  • \$\begingroup\$ Scala 2.13 wont compile this: error: postfix operator toInt needs to be enabled by making the implicit value scala.language.postfixOps visible. \$\endgroup\$
    – corvus_192
    Oct 26 '20 at 14:29
2
\$\begingroup\$

Retina, 232 228 bytes


Yup,You doubt me?,Of course,... did I miss something?,please send teh coffee,Watching this endless list of newqs never gets boring,Kinda sorta,You should totally drop that and use jQuery,¯\_(ツ)_/¯,... goodq
q
 question
?S`,

Try it online! Explanation: The first two stages replace the empty input with the given string, the second stage saving 4 bytes by deduplicating the substring question, while the last stage splits it on commas and outputs a random element. Note that the byte count has been adjusted for UTF-8 (Retina normally uses ISO-8859-1 if it can, which is why TIO only shows the character count rather than the byte count). Edit: I used @Leo's Retina Kolmogorov golfer to detect the duplication and save 4 bytes.

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

PHP, 261 253 bytes

-8: Change <?php echo to <?= (@nthnchu)

<?=explode(",","Yup,You doubt me?,Of course,... did I miss something?,plz send teh coffee,Watching this endless list of new questions never gets boring,Kinda sorta,You should totally drop that and use jQuery,¯\_(ツ)_/¯,... good question")[rand(0,9)];

Try it online!

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

Vyxal, 150 bytes

`Yup|λ⍎ řð me?|Of ⟑ₑ|... ¬⁌ I ɾ⟑ ⟇↜?|plz ¬Ĵ teh ʁƛ|←⍋ λ« ⊛⟑ λ′ of λÞ ∨Œ ∨ſ Ô₂ ℅⁑|ₑ¥ °⊛a|λ⍎ ƛð ∺⁂ ɽ∫ λ⟇ λ¬ λʗ jßø|\¯\\_(`12484C+`)_\\\¯|... ƛ∫ ⟇¹`+\|/℅

Try it Online!

I decided to use an alternate approach with the new built-ins

\$\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.