Skip to main content
made fixes
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Perl 6, 91 bytes

-1 bytes thanks to nwellnhof

.put for (("[@]"if Date.today~~/12.(0?<{@(^26}>))$/),"[ ]"xx$0]"xx+$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!Try it online!

Explanation:

.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?<{@(^26}>))$/), # [@] if today is within the Christmas period
          "[ ]"xx$0]"xx+$0,      # As many [ ]s as the current date
          +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # SplitAnd split into chunks of 5

Perl 6, 91 bytes

.put for (("[@]"if Date.today~~/12.(0?<{^26}>)$/),"[ ]"xx$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!

Explanation:

.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?<{^26}>)$/), # [@] if today is within the Christmas period
         "[ ]"xx$0,      # As many [ ]s as the current date
         +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # Split into chunks of 5

Perl 6, 91 bytes

-1 bytes thanks to nwellnhof

.put for (("[@]"if Date.today~~/12.(0?@(^26))$/),"[ ]"xx+$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!

Explanation:

.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?@(^26))$/), # [@] if today is within the Christmas period
          "[ ]"xx+$0,     # As many [ ]s as the current date
          +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # And split into chunks of 5
added explanation
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Perl 6, 9391 bytes

.put for (("[@]"if Date.today~~/12.(0?<{^26}>)$/),"[ ]"xx ^$0]"xx$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!Try it online!

Explanation:

.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?<{^26}>)$/), # [@] if today is within the Christmas period
         "[ ]"xx$0,      # As many [ ]s as the current date
         +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # Split into chunks of 5

Perl 6, 93 bytes

.put for (("[@]"if Date.today~~/12.(0?<{^26}>)$/),"[ ]"xx ^$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!

Perl 6, 91 bytes

.put for (("[@]"if Date.today~~/12.(0?<{^26}>)$/),"[ ]"xx$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!

Explanation:

.put for (     ...    )         # Print for each of
          ("[@]"if Date.today~~/12.(0?<{^26}>)$/), # [@] if today is within the Christmas period
         "[ ]"xx$0,      # As many [ ]s as the current date
         +$0^..25        # All the number from today to the 25th
                      [*;*]                  # Flatten
                           .pick(*)          # Randomise
                                   .rotor(5) # Split into chunks of 5
Source Link
Jo King
  • 47.5k
  • 5
  • 125
  • 186

Perl 6, 93 bytes

.put for (("[@]"if Date.today~~/12.(0?<{^26}>)$/),"[ ]"xx ^$0,+$0^..25)[*;*].pick(*).rotor(5)

Try it online!