Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

Return to Revisions

4 of 4
deleted 27 characters in body
totallyhuman
  • 17.4k
  • 3
  • 34
  • 89

Jelly, 13 bytes

2X"¢;ÆS»ẋ"ʋ¢»

Try it online!

Explanation:

2X"¢;ÆS»ẋ"ʋ¢»
2X Random number (1 or 2)
 "¢;ÆS» Compressed string equivalent to "duck\n"
 ẋ Repeat the "duck\n" that random number of times
 "ʋ¢» Compresses string equivalent to "goose"
 Implicitly concatenated and returned

More readable version: Try it online!

Will always return 1 or 2 ducks.

user202729
  • 17.6k
  • 2
  • 39
  • 71

AltStyle によって変換されたページ (->オリジナル) /