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

1 of 3
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

05AB1E, 26 bytes

75L5äε.r5£N<i'22ドルǝ]‘Èß‘Sš»

Try it online.

Explanation:

75L # Push a list in the range [1,75]
 5ä # Split it into five equal-sized parts
 ε # Map over each part:
 .r # Randomly shuffle the list
 5£ # Then only keep the first 5 integers
 N<i # If the index if 2:
 '2ドル '# Push dictionary string "free"
 2ǝ # Insert it at (0-based) index 2 into the quintuplet-list
 ] # Close both the if-statement and map
 ‘Èß‘ # Push dictionary string "BINGO"
 S # Convert it to a list of characters: ["B","I","N","G","O"]
 š # Prepend it to the matrix
 » # Join each inner list by spaces; and then each string by newlines
 # (after which the result is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why '2ドル is "free" and ‘Èß‘ is "BINGO".

Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

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