g | x | w | all
Bytes Lang Time Link
126Raku Perl 6 rakudo241211T164234Zxrs
127AWK250421T152501Zxrs
168Python 3241221T022257Za random
221Wolfram Language Mathematica241220T142629ZIntroduc
089C clang241210T135333Zjdt
135sed r241210T230648ZJan Blum
049Uiua241210T091014Zbb94
189Setanta241210T084652Zbb94
067Perl 5 p241209T200440ZXcali
107APL+WIN241209T163602ZGraham
040Japt v2.0a0241208T214742ZShaggy
03505AB1E241209T091342ZKevin Cr
098JavaScript Node.js241209T001806ZArnauld
032Vyxal241209T004007Zemanresu
100JavaScript Node.js241209T000152Zl4m2
046Charcoal241208T220856ZNeil
072Retina241208T215034ZNeil
042Jelly241208T213456ZJonathan

Raku (Perl 6) (rakudo), 142 126 bytes

my@c='allworkandnoplaymakesjackadullboy'.comb;say @*ARGS.comb.map({/[A..Za..z]/??($_ eq .uc??@c.shift.uc!!@c.shift)!!$_}).join

Attempt This Online!

Note that this doesn't appear to work in ATO or TIO.

my @c='allworkandnoplaymakesjackadullboy'.comb; # split into array
my @s=@*ARGS.comb;                              # input into array
@s.=map({           # for each element                 
$_~~/\w/            # if it's a alpha character
??($_ eq .uc        # if uppercase
??@c.shift.uc       # pop character and uppercase
!!@c.shift.lc)      # pop character and lowercase
!!$_});             # if not alpha, copy char
say @s.join;        # prettier print

AWK, 127 bytes

{for(split("allworkandnonplaymakesjackadullboy",s,X);i<=NF;i++)printf $i~/[A-Za-z]/?$i~/[A-Z]/?toupper(s[x++%26]):s[x++%26]:$i}

Attempt This Online!

{for(                 # loop and special sentence
split("allworkandnonplaymakesjackadullboy"
,s,X);                # split at each char into array s
i<=NF;                # go through all chars of input
i++)                  # inc
printf $i~/[A-Za-z]/? # if char is letter
$i~/[A-Z]/?           # if uppercase
toupper(s[x++%26]):   # uppercase from special string
s[x++%26]:            # keep lowercase
$i}                   # or alternate not letter char

Python 3, 168 bytes

x=''
c=0
s='allworkandnoplaymakesjackadullboy'
for i in input():x+=i if not i.isalpha()else s[c%33]if i.islower()else s[c%33].upper();c+=1 if i.isalpha()else 0
print(x)

more readable:

x=''
c=0
s='allworkandnoplaymakesjackadullboy'
for i in input():
  x+=i if not i.isalpha()else s[c%33]if i.islower()else s[c%33].upper()
  c+=1if i.isalpha()else 0
print(x)

explanation: (scroll to the right)

x=''
c=0
s='allworkandnoplaymakesjackadullboy'
for i in input():
  x+=i if not i.isalpha()else s[c%33]if i.islower()else s[c%33].upper()
  c+=1if i.isalpha()else 0
print(x)­⁡​‎‎⁡⁠⁡‏⁠‎⁡⁠⁢‏⁠‎⁡⁠⁣‏⁠‎⁡⁠⁤‏‏​⁡⁠⁡‌⁢​‎‎⁢⁠⁡‏⁠‎⁢⁠⁢‏⁠‎⁢⁠⁣‏‏​⁡⁠⁡‌⁣​‎‎⁣⁠⁡‏⁠‎⁣⁠⁢‏⁠‎⁣⁠⁣‏⁠‎⁣⁠⁤‏⁠‎⁣⁠⁢⁡‏⁠‎⁣⁠⁢⁢‏⁠‎⁣⁠⁢⁣‏⁠‎⁣⁠⁢⁤‏⁠‎⁣⁠⁣⁡‏⁠‎⁣⁠⁣⁢‏⁠‎⁣⁠⁣⁣‏⁠‎⁣⁠⁣⁤‏⁠‎⁣⁠⁤⁡‏⁠‎⁣⁠⁤⁢‏⁠‎⁣⁠⁤⁣‏⁠‎⁣⁠⁤⁤‏⁠‎⁣⁠⁢⁡⁡‏⁠‎⁣⁠⁢⁡⁢‏⁠‎⁣⁠⁢⁡⁣‏⁠‎⁣⁠⁢⁡⁤‏⁠‎⁣⁠⁢⁢⁡‏⁠‎⁣⁠⁢⁢⁢‏⁠‎⁣⁠⁢⁢⁣‏⁠‎⁣⁠⁢⁢⁤‏⁠‎⁣⁠⁢⁣⁡‏⁠‎⁣⁠⁢⁣⁢‏⁠‎⁣⁠⁢⁣⁣‏⁠‎⁣⁠⁢⁣⁤‏⁠‎⁣⁠⁢⁤⁡‏⁠‎⁣⁠⁢⁤⁢‏⁠‎⁣⁠⁢⁤⁣‏⁠‎⁣⁠⁢⁤⁤‏⁠‎⁣⁠⁣⁡⁡‏⁠‎⁣⁠⁣⁡⁢‏⁠‎⁣⁠⁣⁡⁣‏⁠‎⁣⁠⁣⁡⁤‏⁠‎⁣⁠⁣⁢⁡‏‏​⁡⁠⁡‌⁤​‎‎⁤⁠⁡‏⁠‎⁤⁠⁢‏⁠‎⁤⁠⁣‏⁠‎⁤⁠⁤‏⁠‎⁤⁠⁢⁡‏⁠‎⁤⁠⁢⁢‏⁠‎⁤⁠⁢⁣‏⁠‎⁤⁠⁢⁤‏⁠‎⁤⁠⁣⁡‏⁠‎⁤⁠⁣⁢‏⁠‎⁤⁠⁣⁣‏⁠‎⁤⁠⁣⁤‏⁠‎⁤⁠⁤⁡‏⁠‎⁤⁠⁤⁢‏⁠‎⁤⁠⁤⁣‏⁠‎⁤⁠⁤⁤‏⁠‎⁤⁠⁢⁡⁡‏‏​⁡⁠⁡‌⁢⁡​‎‎⁢⁡⁠⁣‏⁠‎⁢⁡⁠⁤‏⁠‎⁢⁡⁠⁢⁡‏⁠‎⁢⁡⁠⁢⁢‏⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠⁠‏​⁡⁠⁡‌⁢⁢​‎‎⁢⁡⁠⁢⁤‏⁠‎⁢⁡⁠⁣⁡‏⁠‎⁢⁡⁠⁣⁢‏⁠‎⁢⁡⁠⁣⁣‏⁠‎⁢⁡⁠⁣⁤‏⁠‎⁢⁡⁠⁤⁡‏⁠‎⁢⁡⁠⁤⁢‏⁠‎⁢⁡⁠⁤⁣‏⁠‎⁢⁡⁠⁤⁤‏⁠‎⁢⁡⁠⁢⁡⁡‏⁠‎⁢⁡⁠⁢⁡⁢‏⁠‎⁢⁡⁠⁢⁡⁣‏⁠‎⁢⁡⁠⁢⁡⁤‏⁠‎⁢⁡⁠⁢⁢⁡‏⁠‎⁢⁡⁠⁢⁢⁢‏⁠‎⁢⁡⁠⁢⁢⁣‏⁠‎⁢⁡⁠⁢⁢⁤‏⁠‎⁢⁡⁠⁢⁣⁡‏‏​⁡⁠⁡‌⁢⁣​‎‎⁢⁡⁠⁢⁣⁢‏⁠‎⁢⁡⁠⁢⁣⁣‏⁠‎⁢⁡⁠⁢⁣⁤‏⁠‎⁢⁡⁠⁢⁤⁡‏⁠‎⁢⁡⁠⁢⁤⁢‏⁠‎⁢⁡⁠⁢⁤⁣‏⁠‎⁢⁡⁠⁢⁤⁤‏⁠‎⁢⁡⁠⁣⁡⁡‏⁠‎⁢⁡⁠⁣⁡⁢‏⁠‎⁢⁡⁠⁣⁡⁣‏⁠‎⁢⁡⁠⁣⁡⁤‏⁠‎⁢⁡⁠⁣⁢⁡‏‏​⁡⁠⁡‌⁢⁤​‎‎⁢⁡⁠⁣⁢⁢‏⁠‎⁢⁡⁠⁣⁢⁣‏⁠‎⁢⁡⁠⁣⁢⁤‏⁠‎⁢⁡⁠⁣⁣⁡‏⁠‎⁢⁡⁠⁣⁣⁢‏⁠‎⁢⁡⁠⁣⁣⁣‏⁠‎⁢⁡⁠⁣⁣⁤‏⁠‎⁢⁡⁠⁣⁤⁡‏⁠‎⁢⁡⁠⁣⁤⁢‏⁠‎⁢⁡⁠⁣⁤⁣‏⁠‎⁢⁡⁠⁣⁤⁤‏⁠‎⁢⁡⁠⁤⁡⁡‏⁠‎⁢⁡⁠⁤⁡⁢‏⁠‎⁢⁡⁠⁤⁡⁣‏‏​⁡⁠⁡‌⁣⁡​‎‎⁢⁡⁠⁤⁡⁤‏⁠‎⁢⁡⁠⁤⁢⁡‏⁠‎⁢⁡⁠⁤⁢⁢‏⁠‎⁢⁡⁠⁤⁢⁣‏⁠‎⁢⁡⁠⁤⁢⁤‏⁠‎⁢⁡⁠⁤⁣⁡‏⁠‎⁢⁡⁠⁤⁣⁢‏⁠‎⁢⁡⁠⁤⁣⁣‏⁠‎⁢⁡⁠⁤⁣⁤‏⁠‎⁢⁡⁠⁤⁤⁡‏⁠‎⁢⁡⁠⁤⁤⁢‏⁠‎⁢⁡⁠⁤⁤⁣‏⁠‎⁢⁡⁠⁤⁤⁤‏⁠‎⁢⁡⁠⁢⁡⁡⁡‏⁠‎⁢⁡⁠⁢⁡⁡⁢‏⁠‎⁢⁡⁠⁢⁡⁡⁣‏⁠‎⁢⁡⁠⁢⁡⁡⁤‏⁠‎⁢⁡⁠⁢⁡⁢⁡‏⁠‎⁢⁡⁠⁢⁡⁢⁢‏⁠‎⁢⁡⁠⁢⁡⁢⁣‏‏​⁡⁠⁡‌⁣⁢​‎‎⁢⁢⁠⁣‏⁠‎⁢⁢⁠⁤‏⁠‎⁢⁢⁠⁢⁡‏⁠‎⁢⁢⁠⁢⁢‏⁠‎⁢⁢⁠⁢⁣‏⁠‎⁢⁢⁠⁢⁤‏⁠‎⁢⁢⁠⁣⁡‏⁠‎⁢⁢⁠⁣⁢‏⁠‎⁢⁢⁠⁣⁣‏⁠‎⁢⁢⁠⁣⁤‏⁠‎⁢⁢⁠⁤⁡‏⁠‎⁢⁢⁠⁤⁢‏⁠‎⁢⁢⁠⁤⁣‏⁠‎⁢⁢⁠⁤⁤‏⁠‎⁢⁢⁠⁢⁡⁡‏⁠‎⁢⁢⁠⁢⁡⁢‏⁠‎⁢⁢⁠⁢⁡⁣‏⁠‎⁢⁢⁠⁢⁡⁤‏⁠‎⁢⁢⁠⁢⁢⁡‏⁠‎⁢⁢⁠⁢⁢⁢‏⁠‎⁢⁢⁠⁢⁢⁣‏⁠‎⁢⁢⁠⁢⁢⁤‏⁠‎⁢⁢⁠⁢⁣⁡‏⁠‎⁢⁢⁠⁢⁣⁢‏‏​⁡⁠⁡‌⁣⁣​‎‎⁢⁣⁠⁡‏⁠‎⁢⁣⁠⁢‏⁠‎⁢⁣⁠⁣‏⁠‎⁢⁣⁠⁤‏⁠‎⁢⁣⁠⁢⁡‏⁠‎⁢⁣⁠⁢⁢‏⁠‎⁢⁣⁠⁢⁣‏⁠‎⁢⁣⁠⁢⁤‏‏​⁡⁠⁡‌­

x=''                                                                     # ‎⁡init solution variable
c=0                                                                      # ‎⁢init counter
s='allworkandnoplaymakesjackadullboy'                                    # ‎⁣the string to convert into
for i in input():                                                        # ‎⁤loop around input
  x+=i                                                                   # ‎⁢⁡add current char to x as is
       if not i.isalpha()                                                # ‎⁢⁢if the current character is not a letter
                         else s[c%33]                                    # ‎⁢⁣otherwise add the c'th value of the string to x
                                     if i.islower()                      # ‎⁢⁤if the current character is lowercase
                                                   else s[c%33].upper()  # ‎⁣⁡or add the uppercase c'th value of the string to x (only other case)
  c+=1if i.isalpha()else 0                                               # ‎⁣⁢if the current character is a letter, increment c
print(x)                                                                 # ‎⁣⁣output x
💎

Created with the help of Luminespire.

(noob solution, hopefully it's not that bad)

Wolfram Language (Mathematica), 221 bytes 229 bytes

(w=#~StringCases~LetterCharacter;j=1;StringJoin[If[LetterQ@#,#/.Thread[w->MapThread[If[#2,ToUpperCase@#,#]&,{Characters@StringTake["allworkandnoplaymakesjackadullboy",Length@w],UpperCaseQ/@w}]][[j++]],#]&/@Characters@#])&

Try it online!

C (clang), 91 89 bytes

i;f(*s){for(i=0;*s++=isalpha(*s)?"ALLWORKANDNOPLAYMAKESJACKADULLBOY"[i++%33]|*s&32:*s;);}

Try it online!

sed -r, 135 bytes

Needs to be run with LC_COLLATE=C to make sure that the range expression [A-Z] actually means "uppercase letters".

The script of 135 bytes (TIO link) is pure ASCII, and contains four different non-printable control characters; these are visually represented by Ø, ø, ¦, and in the listing below (the latter being encoding-dependent, and possibly longer than one byte).

s/[A-Z]/Ø/g
s/[a-z]/ø/g
:1
/¦y/!s/$/¦yoblludakcajsekamyalpondnakrowlla/
s/(Ø|ø)(.+)(.)$/\1™\3\2/
s/Ø™(.)/\u\1/
s/ø™(.)/\l\1/
t1
s/¦.*//

Try it online! (Wrapped in bash to force the C locale)

Uiua, 49 bytes (SBCS)

⍜⊏(×↯:"ALLWORKANDNOPLAYMAKESJACKADULLBOY"△.±)⊚⌵±.

Pad

Setanta, 189 bytes

gniomh(s){t:=""j:=0le i idir(0,fad@s){i=s[i]ma'@'<i&i<'[' t+="ALLWORKANDNOPLAYMAKESJACKADULLBOY"[j]no ma'`'<i&i<'{' t+="allworkandnoplaymakesjackadullboy"[j]no{j-=1t+=i}j=(j+1)%33}toradh t}

try-setanta.ie link

Perl 5 -p, 67 bytes

s,\pL,($&&$")|(ALLWORKANDNOPLAYMAKESJACKADULLBOY=~/./g)[$i++%33],ge

Try it online!

APL+WIN, 107 bytes

Prompts for string.

⎕av[(48×j)+(v×i=0)+i←i\(+/i←((v>17)^v<44)∨j←(v>65)^(v←⎕av⍳⎕)<92)⍴s←⎕av⍳'allworkandnoplaymakesjackadullboy']

Try it online! Thanks to Dyalog Classic

Japt v2.0a0, 40 bytes

r\l@T°g`a¥wŽk„dnoplayµkƒjàÚÍé¾y`c^H*Xè\A

Try it or run all test cases

r\l@T°g`...`c^H*Xè\A     :Implicit input of string
r                        :Replace
 \l                      :RegEx /[a-z]/gi
   @                     :Pass each match X through the following function
    T°                   :  Postfix increment T (initially 0)
      g                  :  0-based index into
       `...`             :    Compressed string "allworkandnoplaymakesjackadullboy"
            c            :    Map charcodes
             ^           :      Bitwise XOR with
              H          :      32
               *         :      Multiplied by
                Xè       :      Count the occurrences in X of
                  \A     :      RegEx /[A-Z]/

05AB1E, 35 bytes

εDai’€Ÿ‚Ÿ€ƒ€¸†•ŠŽ—Éadullíå’¾è¼s.uiu

Output as a list of characters.

Try it online or verify all test cases.

Explanation:

ε             # Map over each character of the (implicit) input:
 D            #  Duplicate the current character
  ai          #  Pop the copy, and if it's a letter:
    ’€Ÿ‚Ÿ€ƒ€¸†•ŠŽ—Éadullíå’
              #   Push dictionary string "allworkandnoplaymakesjackadullboy"
      ¾è      #   Get the 0-based `¾`'th character from this string (starts at 0)
        ¼     #   Then increase `¾` by 1 for the next iteration
        s     #   Swap so the current letter is at the top again
         .ui  #   Pop, and if it's uppercase:
            u #    Uppercase the indexed letter as well
              #   (implicit else: leave it lowercase)
              #  (implicit else: use the current duplicated character instead)
              # (after which the resulting character-list is output implicitly)

See this 05AB1E tip of mine (section How to use the dictionary?) to understand why ’€Ÿ‚Ÿ€ƒ€¸†•ŠŽ—Éadullíå’ is "allworkandnoplaymakesjackadullboy" (although a compressed string .•1Á› Aƶ5~]ô/;ÖYµ¯?*mò• is apparently the exact same length in this case: try it online.)

JavaScript (Node.js), 98 bytes

-2 thanks to @l4m2

Expects and returns a string.

s=>(B=Buffer)(s).map(c=>(c-65&95)<26?B("ALLWORKANDNOPLAYMAKESJACKADULLBOY")[i++%33]|c&32:c,i=0)+""

Try it online!


JavaScript (Node.js), 88 bytes

Expects and returns a buffer.

a=>a.map(c=>(c-65&95)<26?Buffer("ALLWORKANDNOPLAYMAKESJACKADULLBOY")[i++%33]|c&32:c,i=0)

Try it online!

Vyxal, 32 bytes

fǍT≬L`λæƛ¢an∩„∨¯»¦¢₴a∩‛l½ė`Ẏ¢∑?•

Try it Online!

f               # Convert to a list of chars
  T             # And find the indices where
 Ǎ              # Removing non-letters yields a truthy string i.e. char is letter
   ≬-------¢    # Apply the following to the values at those indices, together:
          Ẏ     # Take the first
    L           # (length of values) characters, wrapping as necessary, of
     `...`      # compressed string "allworkandnoplaymakesjackadullboy"
            ∑   # Concatenate
             ?• # And transfer the case of the input.

JavaScript (Node.js), 100 bytes

x=>x.replace(/[a-z]/gi,c=>c<{t:t='allworkandnoplaymakesjackadullboy'[i++%33]}?t.toUpperCase():t,i=0)

Try it online!

Charcoal, 46 bytes

⭆S⎇№α↥ι⭆§”&⌊⊟“⬤T>τïL⦄⁻!ζPA;>εü⌈≔”L⊞Oυω⎇№αι↥λλι

Try it online! Link is to verbose version of code. Explanation:

 S                          Input string
⭆                           Map over characters and join
    α                       Predefined variable uppercase alphabet
   №                        Contains
      ι                     Current character
     ↥                      Uppercased
  ⎇                         If true then
         ”...”              1-indexed phrase
        §                   Indexed by
                  ω         Empty string
               ⊞O           Pushed to
                 υ          Predefined variable empty list
              L             Take the length
       ⭆                    Map over character
                     α      Predefined variable uppercase alphabet
                    №       Contains
                      ι     Outer character
                   ⎇        If true then
                        λ   Inner character
                       ↥    Uppercased
                         λ  Otherwise inner character
                          ι Otherwise outer character
                            Implicitly print

Retina, 72 bytes

T`l`\o
[A-Z]
Ao
Y`o`a\l\l\workan\dn-p\laymakesjacka\du\l\lboy
T`Al`_L`A.

Try it online! Link includes test cases. Explanation:

T`l`\o

Change all lowercase letters to os. o has to be quoted because it's magic and I don't want it to be magic here. (l is also magic but that's deliberate.)

[A-Z]
Ao

Change all uppercase letters to Aos.

Y`o`a\l\l\workan\dn-p\laymakesjacka\du\l\lboy

Cyclically transliterate as to the given phrase. d, l, o, p and w are normally magic and have to be quoted, but fortunately I get to use n-p in place of no\p, and o isn't magic when it appears on both sides.

T`Al`_L`A.

Capitalise letters following As, deleting those As.

Jelly, 42 bytes

nŒsÄị“ṢhqQẋøḤ×HßżṘĊo6.Ṿ§@Þƒ»a@Ʋo⁸Œu⁸=ŒuT¤¦

A monadic Link that accepts the clue as a list of characters and yields the encrypted clue as a list of characters.

Try it online!

How?

nŒsÄị“...»a@Ʋo⁸Œu⁸=ŒuT¤¦ - Link: list of characters, Clue
 Œs                      - swap case {Clue}
n                        - {Clue} not equal {that} (vectorises) -> isLetterVector
            Ʋ            - last four links as a monad - f(isLetterVector):
   Ä                     -   cumulative sums
     “...»               -   "allworkandnoplaymakesjackadullboy"
    ị                    -   {CumSums} index into {that} (modular) (vectorises)
          a@             -   {isLetterVector} logical AND {that} (vectorises)
             o⁸          - logical OR {Clue} (vectorises)
                       ¦ - sparse application...
                      ¤  - ...to indices: nilad followed by links as a nilad:
                 ⁸       -                  Clue
                   Œu    -                  {Clue} to uppercase
                  =      -                  equal? (vectorises)
                     T   -                  truthy indices
               Œu        - ...apply: uppercase