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 Answer

fixed
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

05AB1E, 3132 bytes

F75L5äε.r5£N<i'22ドルǝ}}‘Èß‘S𻸑Èß‘Sš»,¶?

Try it online. Try it online.

Explanation:

F # Loop the (implicit) input-integer amount of times:
 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 is 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
 ‘Èß‘ ø # Zip/transpose the matrix; swapping rows/columns
  ‘Èß‘ # Push dictionary string "BINGO"
 S 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
 , # Pop and print it with trailing newline
 ¶? # And print an additional newline character

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

05AB1E, 31 bytes

F75L5äε.r5£N<i'22ドルǝ}}‘Èß‘Sš»,¶?

Try it online.

Explanation:

F # Loop the (implicit) input-integer amount of times:
 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 is 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
 , # Pop and print it with trailing newline
 ¶? # And print an additional newline character

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

05AB1E, 32 bytes

F75L5äε.r5£N<i'22ドルǝ}}ø‘Èß‘Sš»,¶?

Try it online.

Explanation:

F # Loop the (implicit) input-integer amount of times:
 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 is 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
  ø # Zip/transpose the matrix; swapping rows/columns
  ‘Èß‘ # 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
 , # Pop and print it with trailing newline
 ¶? # And print an additional newline character

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

Post Undeleted by Kevin Cruijssen
added 227 characters in body
Source Link
Kevin Cruijssen
  • 136.2k
  • 14
  • 154
  • 394

05AB1E, 2631 bytes

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

Try it online. Try it online.

Explanation:

F # Loop the (implicit) input-integer amount of times:
 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 ifis 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 whichPop theand resultprint isit outputwith implicitly)trailing newline
 ¶? # And print an additional newline character

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

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

05AB1E, 31 bytes

F75L5äε.r5£N<i'22ドルǝ}}‘Èß‘Sš»,¶?

Try it online.

Explanation:

F # Loop the (implicit) input-integer amount of times:
 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 is 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
 , # Pop and print it with trailing newline
 ¶? # And print an additional newline character

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

Post Deleted by Kevin Cruijssen
Source Link
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".

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