Implementa el comando Smokey's !! / alive
Nota : SmokeDetector es un bot que detecta spam y publicaciones ofensivas en la red y envía alertas al chat.
Que implementar
El !!/alivecomando de Smokey escoge uniformemente al azar uno de estos mensajes:
- Sip
- ¿Dudas de mi?
- Por supuesto
- ... ¿Me he perdido algo?
- por favor envíe el café
- Ver esta lista interminable de nuevas preguntas nunca se vuelve aburrido
- Un poco sorta
- Deberías dejar eso por completo y usar jQuery
- ¯ \ _ (ツ) _ / ¯
- ... buena pregunta
y lo imprime en la pantalla.
Su tarea es implementar ese comando.
Reglas
Código de golf regular: gana la respuesta más corta en bytes;)
¡Buena suerte!
Respuestas
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")
¡Pruébelo en línea!
05AB1E , 123 bytes
Žmõ甡¸€îååªç€î”#`“Yup
ÿ¬³€á?
Of…£
...ƒ§ Iš§†á?
plzƒ¨ teh™²
ÿ€Œèႇ€‚€¢…醙–ÜÜÀ
ÿŠœa
ÿ‚©§À›Â€Š€ƒ€Å jÿ
¯\_(ÿ)_/¯
...‚¿†ä“¶¡Ω
¡Pruébelo en línea!
Nota: Imprime una respuesta aleatoria con una nueva línea al final.
Jugó al golf con el conocido consejo de golf de @ KevinCruijssen.
Explicación
Ž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
Hecho aleatorio: estaba a mitad de camino en la creación de este programa cuando mi computadora portátil se bloqueó. Tuve que empezar a codificar de nuevo. ¡Oh, bueno, al menos mi respuesta es ganadora al momento de escribir esto!
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))
¡Pruébelo en línea!
Gelatina , 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
¡Pruébelo en línea!
Codifica toda la cadena pero reemplazando el encogimiento de hombros con !\_(!)_/!(ya !que no aparece en la cadena y solo se permiten ASCII / nuevas líneas imprimibles), y luego reemplaza !con el símbolo de la barra superior, y luego simplemente establece el carácter japonés en ese índice manualmente.
Luego, divida por líneas nuevas y seleccione una aleatoria.
Python 3 , 283 274 bytes
-9 bytes gracias a 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(',')))
¡Pruébelo en línea!
JavaScript, 297 287 285 277 265 bytes
-10 bytes reemplazando Math.floor()con~~()
-2 bytes reemplazando ~~()con |0gracias a @Neil
-8 bytes reemplazando la matriz con string.split(',')
-12 bytes colocando opciones directamente dentro de alert()y reemplazándolas string.split(',')constring.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])
Violín
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"\
¡Pruébelo en línea!
Dato curioso: si utilizara una cadena "empaquetada", el recuento de bytes aumentaría hasta 388.
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";
¡Pruébelo en línea!
Si devolver una cadena es aceptable, el principio `0:y el final ;se pueden elidir para ahorrar 4 bytes.
De carbón , 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¦¯\_(ツ)_/¯
¡Pruébelo en línea! El enlace corresponde a la versión detallada del código. Editar: Guardado 1 byte usando Acomo separador. Nota: El deverbosifier reclama 148 147 bytes, pero creo que ¯(como ツ) necesita ser codificado usando 3 bytes en carbón de leña. Explicación: El carbón vegetal solo puede comprimir cadenas de ASCII imprimible, por lo que el encogimiento de hombros se agrega por separado.
”...” Compressed string
⪪ ¶ Split on newlines
⊞O ¯\_(ツ)_/¯ Push literal string
‽ Random element
Implicitly print
C (GCC) , 294 290 289 bytes
4 bytes guardados gracias a ErikF !!!
Guardado un byte gracias a roofcat !!!
*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]);}
¡Pruébelo en línea!
rand()Selección sencilla de una variedad de cadenas.
Retina , 232 bytes
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
?S`,
¡Pruébelo en línea! Explicación: La primera etapa reemplaza la entrada vacía con la cadena dada, mientras que la segunda etapa la divide en comas y genera un elemento aleatorio. Tenga en cuenta que el recuento de bytes se ha ajustado para UTF-8 (Retina normalmente usa ISO-8859-1 si puede, por lo que TIO solo muestra el recuento de caracteres en lugar del recuento de bytes).
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]}
¡Pruébelo en línea!
Scala , 278267 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))
¡Pruébelo en línea!
- -21 ¡Gracias a corvus-192 !
PHP,
261
253 bytes
-8: Cambiar <?php echo a <?=( @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)];
¡Pruébelo en línea!
Vyxal , 162 bytes
`Yup``λ∆ ĺĶ me?``Of ∨ſ``...∧ŋ I ƈ∨ ÷ŷ?``plz ∧ō teh Þ¬``ĸš λ» ƃ∨ λĖ of λ⫙ ⟇Ŧ ⟇⎡ ʀč ŴŔ``ſŪ ․ƃa`175C\\`_(`12484C`)_/`175C+++++`λ∆ ¬Ķ ĴŐ ∞ş λ÷ λ∧ λŜ jĤÇ``... ¬ş ÷Ž`WŢ
Empuje todas las cadenas con compresión de diccionario, pase a una lista y elija un objeto aleatorio.