Implémenter la commande !! / alive de Smokey

Oct 24 2020

Remarque : SmokeDetector est un robot qui détecte le spam et les messages offensants sur le réseau et publie des alertes pour discuter.

Que mettre en œuvre

La !!/alivecommande de Smokey sélectionne uniformément au hasard l'un de ces messages:

  • Ouaip
  • Vous doutez de moi?
  • Bien sûr
  • ... ai-je oublié quelque chose?
  • plz envoyer le café
  • Regarder cette liste interminable de nouvelles questions n'est jamais ennuyeux
  • Kinda sorta
  • Vous devriez totalement abandonner cela et utiliser jQuery
  • ¯ \ _ (ツ) _ / ¯
  • ... bonne question

et l'imprime à l'écran.

Votre tâche consiste à implémenter cette commande.

Règles

Code-golf régulier - la réponse la plus courte en octets gagne;)

Bonne chance!

Réponses

12 Sisyphus Oct 25 2020 at 03:43

Python 2 , 240 octets

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")

Essayez-le en ligne!

7 SunnyMoon Oct 25 2020 at 10:23

05AB1E , 123 octets

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

Essayez-le en ligne!

Remarque: imprime une réponse aléatoire avec une nouvelle ligne à la fin.

Joué au golf en utilisant le conseil de golf bien connu de @ KevinCruijssen.

Explication

Ž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

Aléatoire: j'étais à mi-chemin dans la création de ce programme lorsque mon ordinateur portable est tombé en panne. J'ai dû recommencer à coder. Eh bien, au moins ma réponse est gagnante au moment d'écrire ceci!

6 Giuseppe Oct 24 2020 at 18:56

R , 265 octets

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))

Essayez-le en ligne!

5 HyperNeutrino Oct 24 2020 at 18:33

Gelée , 145 octets

“þ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

Essayez-le en ligne!

Encode la chaîne entière mais en remplaçant le haussement d'épaules par !\_(!)_/!(car !n'apparaît pas dans la chaîne et seuls les ASCII / nouvelles lignes imprimables sont autorisés), puis remplace !par le symbole de la barre supérieure, puis définit simplement le caractère japonais à cet index manuellement.

Ensuite, divisez par nouvelles lignes et sélectionnez-en une au hasard.

4 aidan0626 Oct 24 2020 at 15:38

Python 3 , 283 274 octets

-9 octets grâce à 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(',')))

Essayez-le en ligne!

4 ΛRYΛN Oct 24 2020 at 18:18

JavaScript, 297 287 285 277 265 octets

-10 octets en remplaçant Math.floor()par~~()

-2 octets en remplaçant ~~()par |0merci à @Neil

-8 octets en remplaçant tableau par string.split(',')

-12 octets en plaçant des options directement à l'intérieur de alert()et en les remplaçant string.split(',')parstring.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])

Violon

4 PkmnQ Oct 25 2020 at 11:40

Pyth , 230 octets

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"\	

Essayez-le en ligne!

Fait amusant: si vous utilisiez une chaîne «compressée», le nombre d'octets passerait à 388.

3 coltim Oct 24 2020 at 22:45

K (oK) , 237 octets

`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";

Essayez-le en ligne!

Si le renvoi d'une chaîne est acceptable, le début `0:et la fin ;peuvent être élidés pour économiser 4 octets.

3 Neil Oct 24 2020 at 19:18

Charbon de bois , 152 151 octets

‽⊞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¦¯\_(ツ)_/¯

Essayez-le en ligne! Le lien est vers la version verbeuse du code. Edit: enregistré 1 octet en utilisant Acomme séparateur. Remarque: Le deverbosifier réclame 148 147 octets, mais je crois que ¯(comme ) doit être encodé en utilisant 3 octets dans Charcoal. Explication: Charcoal ne peut compresser que des chaînes de caractères ASCII imprimables, le haussement d'épaules est donc ajouté séparément.

    ”...”               Compressed string
   ⪪     ¶              Split on newlines
 ⊞O        ¯\_(ツ)_/¯    Push literal string
‽                       Random element
                        Implicitly print
2 Noodle9 Oct 24 2020 at 19:01

C (gcc) , 294 290 289 octets

Sauvegardé 4 octets grâce à ErikF !!!
Sauvé un octet grâce à plafonnier !!!

*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]);}

Essayez-le en ligne!

rand()Sélection simple à partir d'un tableau de chaînes.

2 Neil Oct 25 2020 at 10:22

Rétine , 232 octets


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`,

Essayez-le en ligne! Explication: La première étape remplace l'entrée vide par la chaîne donnée, tandis que la deuxième étape la divise par des virgules et génère un élément aléatoire. Notez que le nombre d'octets a été ajusté pour UTF-8 (Retina utilise normalement ISO-8859-1 si elle le peut, c'est pourquoi TIO n'affiche que le nombre de caractères plutôt que le nombre d'octets).

2 nthnchu Oct 25 2020 at 15:27

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]}

Essayez-le en ligne!

2 TomerShetah Oct 25 2020 at 13:39

Scala , 278 267 octets

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))

Essayez-le en ligne!

1 nthnchu Oct 25 2020 at 17:48

PHP, 261253 octets

-8: Changer <?php echo pour <?=( @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)];

Essayez-le en ligne!

1 Lyxal Oct 26 2020 at 04:58

Vyxal , 162 octets

`Yup``λ∆ ĺĶ me?``Of ∨ſ``...∧ŋ I ƈ∨ ÷ŷ?``plz ∧ō teh Þ¬``ĸš λ» ƃ∨ λĖ of λ⫙ ⟇Ŧ ⟇⎡ ʀč ŴŔ``ſŪ ․ƃa`175C\\`_(`12484C`)_/`175C+++++`λ∆ ¬Ķ ĴŐ ∞ş λ÷ λ∧ λŜ jĤÇ``... ¬ş ÷Ž`WŢ

Poussez toutes les chaînes avec la compression du dictionnaire, enveloppez dans une liste et choisissez un objet aléatoire.