Skip to main content
Commonmark migration
Source Link

#05AB1E, 38 37 32 31 30 bytes

05AB1E, 38 37 32 31 30 bytes

#05AB1E, 38 37 32 31 30 bytes

05AB1E, 38 37 32 31 30 bytes

added 249 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 38 37 32 31 31 30 bytes

žeD₂‹žf12QP'@ú€…[ÿ]Dg25Ÿ«¦žeD₂‹žf‹P'@ú€…[ÿ]Dg25Ÿ«¦.r5ô»

-56 bytes thanks to @Grimmy.

Try it onlineTry it online or try it online with own specified month / daytry it online with own specified month / day.

že           # Push the current day
  D          # Duplicate it
   ₂‹        # Check if it's smaller than 26
     žf      # Push the current month
       12QÂ    # CheckBifurcate it (short for Duplicate & Reverse copy)
        ‹   # And check if it'sthis equalis tosmaller than the month itself
            # (this will check 1-9 < 1-9 (falsey); 10 < 01 (falsey); 11 < 11 (falsey);
            #  and 12 < 21 (thustruthy) - so this will only be truthy for 12 / December)
          P  # Take the product of the day and both checks,
             # which result in either the day, or 0 if either check was falsey
'@          '# Push character "@"
  ú          # Pad it with the earlier number amount of spaces
   €         # Map over each of these characters:
    …[ÿ]     #  Push string "[ÿ]", where the `ÿ` is automatically filled with the character
Dg           # Duplicate the list, and pop and push its length
  25Ÿ        # Create a list in the range [length, 25]
     «       # And merge it to the earlier created list
¦            # Then remove the first item (either a "[ ]", or the "[@]" if the checks
             #                             were falsey)
 .r          # Randomly shuffle the list
   5ô        # Split the list into sublists of size 5
     »       # Join each inner list by spaces, and these strings by newlines
             # (after which the result is output implicitly)

#05AB1E, 38 37 32 31 bytes

žeD₂‹žf12QP'@ú€…[ÿ]Dg25Ÿ«¦.r5ô»

-5 bytes thanks to @Grimmy.

Try it online or try it online with own specified month / day.

že           # Push the current day
  D          # Duplicate it
   ₂‹        # Check if it's smaller than 26
     žf      # Push the current month
       12Q   # Check if it's equal to 12 (thus December)
          P  # Take the product of the day and both checks,
             # which result in either the day, or 0 if either check was falsey
'@          '# Push character "@"
  ú          # Pad it with the earlier number amount of spaces
   €         # Map over each of these characters:
    …[ÿ]     #  Push string "[ÿ]", where the `ÿ` is automatically filled with the character
Dg           # Duplicate the list, and pop and push its length
  25Ÿ        # Create a list in the range [length, 25]
     «       # And merge it to the earlier created list
¦            # Then remove the first item (either a "[ ]", or the "[@]" if the checks
             #                             were falsey)
 .r          # Randomly shuffle the list
   5ô        # Split the list into sublists of size 5
     »       # Join each inner list by spaces, and these strings by newlines
             # (after which the result is output implicitly)

#05AB1E, 38 37 32 31 30 bytes

žeD₂‹žf‹P'@ú€…[ÿ]Dg25Ÿ«¦.r5ô»

-6 bytes thanks to @Grimmy.

Try it online or try it online with own specified month / day.

že          # Push the current day
  D         # Duplicate it
   ₂‹       # Check if it's smaller than 26
     žf     # Push the current month
       Â    # Bifurcate it (short for Duplicate & Reverse copy)
        ‹   # And check if this is smaller than the month itself
            # (this will check 1-9 < 1-9 (falsey); 10 < 01 (falsey); 11 < 11 (falsey);
            #  and 12 < 21 (truthy) - so this will only be truthy for 12 / December)
         P  # Take the product of the day and both checks,
            # which result in either the day, or 0 if either check was falsey
'@         '# Push character "@"
  ú         # Pad it with the earlier number amount of spaces
   €        # Map over each of these characters:
    …[ÿ]    #  Push string "[ÿ]", where the `ÿ` is automatically filled with the character
Dg          # Duplicate the list, and pop and push its length
  25Ÿ       # Create a list in the range [length, 25]
     «      # And merge it to the earlier created list
¦           # Then remove the first item (either a "[ ]", or the "[@]" if the checks
            #                             were falsey)
 .r         # Randomly shuffle the list
   5ô       # Split the list into sublists of size 5
     »      # Join each inner list by spaces, and these strings by newlines
            # (after which the result is output implicitly)
deleted 178 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384

#05AB1E, 38 3737 32 31 bytes

25L.ržf12Qže₂‹*iε…[ ]…[@])yžežeD₂‹žf12QP'@ú€…[ÿ]Dg25Ÿ«¦.SÌè]5ô»r5ô»

Try it online-5 bytes thanks to @Grimmy.

Try it online or try it online with own specified month / daytry it online with own specified month / day.

25L            že           # Push a list in the rangecurrent [1,25]day
   .r        D          # Duplicate it
 # Randomly shuffle₂‹ it
     žf  # Check if it's smaller than 26
     žf      # Push the current month
       12Q                # Check if it's equal to 12 (thus December)
     že              P  # Take the #product Pushof the current day
  and both checks,
   ₂‹          # which result in either the day, #or Check0 if it'seither smallercheck thanwas 26falsey
       '@   *i       '# Push character "@"
  ú  # And if both are truthy:
    # Pad it with the earlier number amount εof spaces
            #  Map each valueover ineach theof listthese tocharacters:
             …[@]    …[ÿ]     #   Push string "[@]"
             …[ ]      "[ÿ]", where the #`ÿ` is automatically Pushfilled stringwith "[the ]"character
             Dg    )        #   Wrap all three intoDuplicate athe list: [value,"[@]","[ ]"]
                  y       # and pop Pushand thepush valueits `y`length
                25Ÿ   že     # Create a Pushlist in the currentrange day[length, again25]
                 «    .S   #   Compare the two values (-1 ifAnd y<day;merge 0it ifto y==day;the 1earlier ifcreated y>day)list
             ¦          Ì  #  Then Increaseremove itthe byfirst 2item (1either ifa y<day;"[ 2]", ifor y==day;the 3"[@]" if y>day)
           the checks
            è #   Use it to (0-based) index into the list (with wraparound,
                          #   so the 3 results in the firstwere itemfalsey)
           ]    .r          # Close theRandomly mapshuffle andthe if-statementlist
                     # Split the list into sublists of size 5
              »           # Join each inner list by spaces, and these strings by newlines
                          # (after which the result is output implicitly)

#05AB1E, 38 37 bytes

25L.ržf12Qže₂‹*iε…[ ]…[@])yže.SÌè]5ô»

Try it online or try it online with own specified month / day.

25L                       # Push a list in the range [1,25]
   .r                     # Randomly shuffle it
     žf                   # Push the current month
       12Q                # Check if it's equal to 12 (thus December)
     že                   # Push the current day
       ₂‹                 # Check if it's smaller than 26
          *i              # And if both are truthy:
            ε             #  Map each value in the list to:
             …[@]         #   Push string "[@]"
             …[ ]         #   Push string "[ ]"
                 )        #   Wrap all three into a list: [value,"[@]","[ ]"]
                  y       #   Push the value `y`
                   že     #   Push the current day again
                     .S   #   Compare the two values (-1 if y<day; 0 if y==day; 1 if y>day)
                       Ì  #   Increase it by 2 (1 if y<day; 2 if y==day; 3 if y>day)
                        è #   Use it to (0-based) index into the list (with wraparound,
                          #   so the 3 results in the first item)
           ]              # Close the map and if-statement
                     # Split the list into sublists of size 5
              »           # Join each inner list by spaces, and these strings by newlines
                          # (after which the result is output implicitly)

#05AB1E, 38 37 32 31 bytes

žeD₂‹žf12QP'@ú€…[ÿ]Dg25Ÿ«¦.r5ô»

-5 bytes thanks to @Grimmy.

Try it online or try it online with own specified month / day.

že           # Push the current day
  D          # Duplicate it
   ₂‹        # Check if it's smaller than 26
     žf      # Push the current month
       12Q   # Check if it's equal to 12 (thus December)
          P  # Take the product of the day and both checks,
             # which result in either the day, or 0 if either check was falsey
'@          '# Push character "@"
  ú          # Pad it with the earlier number amount of spaces
            # Map over each of these characters:
    …[ÿ]     #  Push string "[ÿ]", where the `ÿ` is automatically filled with the character
Dg           # Duplicate the list, and pop and push its length
  25Ÿ        # Create a list in the range [length, 25]
     «       # And merge it to the earlier created list
¦            # Then remove the first item (either a "[ ]", or the "[@]" if the checks
             #                             were falsey)
 .r          # Randomly shuffle the list
   5ô        # Split the list into sublists of size 5
     »       # Join each inner list by spaces, and these strings by newlines
             # (after which the result is output implicitly)
Fixed December 26th-31st
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
added 18 characters in body
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading
Source Link
Kevin Cruijssen
  • 131.4k
  • 13
  • 144
  • 384
Loading