Skip to main content
Fixed some formatting
Source Link
Kamil Drakari
  • 4.4k
  • 11
  • 21

Japt, 37 bytes

;®i`ypetjkkp¡okrtyp©jkyb`pu;®i`…ypetjkŠkp¡okrtyp©jkyb`pu)gCpu bZ

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                                        #Set C to the lowercase alphabet
 ®                                       #For each character Z of the input:
                                   bZ    # Find its index in:
                               C         #  The lowercase alphabet
                                pu       #  Plus the uppercase alphabet
                                         #  (-1 if it is not a letter)
                              g          # And get the character at that index in:
   `…ypetjkŠkp¡okrtyp©jkyb`              #  Get the lowercase Corpus alphabet
                           pu)           #  Plus the uppercase Corpus alphabet
  i                                      #  Add Z at the end (index -1)

Japt, 37 bytes

;®i`ypetjkkp¡okrtyp©jkyb`pu)gCpu bZ

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                                        #Set C to the lowercase alphabet
 ®                                       #For each character Z of the input:
                                   bZ    # Find its index in:
                               C         #  The lowercase alphabet
                                pu       #  Plus the uppercase alphabet
                                         #  (-1 if it is not a letter)
                              g          # And get the character at that index in:
   `…ypetjkŠkp¡okrtyp©jkyb`              #  Get the lowercase Corpus alphabet
                           pu)           #  Plus the uppercase Corpus alphabet
  i                                      #  Add Z at the end (index -1)

Japt, 37 bytes

;®i`…ypetjkŠkp¡okrtyp©jkyb`pu)gCpu bZ

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                                        #Set C to the lowercase alphabet
 ®                                       #For each character Z of the input:
                                   bZ    # Find its index in:
                               C         #  The lowercase alphabet
                                pu       #  Plus the uppercase alphabet
                                         #  (-1 if it is not a letter)
                              g          # And get the character at that index in:
   `…ypetjkŠkp¡okrtyp©jkyb`              #  Get the lowercase Corpus alphabet
                           pu)           #  Plus the uppercase Corpus alphabet
  i                                      #  Add Z at the end (index -1)
added 128 characters in body
Source Link
Kamil Drakari
  • 4.4k
  • 11
  • 21

Japt, 4737 bytes

;
`…ypetjkŠkp¡okrtyp©jkyb`
C+B
£WøX ?Vpu;®i`ypetjkkp¡okrtyp©jkyb`pu)gCpu gWbX:XbZ

Try it online!Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. HereHere is that test case, input as an array of characters instead.

Explanation:

;                           #Use the alternate values for variables        #Set C andto B
the lowercase alphabet
`…ypetjkŠkp¡okrtyp©jkyb` ®   #V = "atypetjkitkpstokrtyputjkyb"

C+B                         #W = lowercase alphabet + uppercase alphabet
   #For each character Z of the input:
£                           #For each character X in the input  bZ    # Find its index in:
                               C         #  The lowercase alphabet
 WøX ?                              pu       # If itPlus isthe inuppercase Walphabet
           WbX                              #  Get(-1 theif indexit inis Wnot a letter)
          g                 #  And replaceg X with        # And get the character at that index in:
   `…ypetjkŠkp¡okrtyp©jkyb`   Vpu           #  Get the lowercase Corpus alphabet
                           pu)           #  VPlus +the uppercaseduppercase VCorpus alphabet
  i            :X                          # Otherwise leaveAdd XZ asat the end (index -is1)

Japt, 47 bytes

;
`…ypetjkŠkp¡okrtyp©jkyb`
C+B
£WøX ?Vpu gWbX:X

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                           #Use the alternate values for variables C and B

`…ypetjkŠkp¡okrtyp©jkyb`    #V = "atypetjkitkpstokrtyputjkyb"

C+B                         #W = lowercase alphabet + uppercase alphabet

£                           #For each character X in the input: 
 WøX ?                      # If it is in W
           WbX              #  Get the index in W
          g                 #  And replace X with the character at that index in
      Vpu                   #  V + uppercased V
              :X            # Otherwise leave X as-is

Japt, 37 bytes

;®i`ypetjkkp¡okrtyp©jkyb`pu)gCpu bZ

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                                        #Set C to the lowercase alphabet
 ®                                       #For each character Z of the input:
                                   bZ    # Find its index in:
                               C         #  The lowercase alphabet
                                pu       #  Plus the uppercase alphabet
                                         #  (-1 if it is not a letter)
                              g          # And get the character at that index in:
   `…ypetjkŠkp¡okrtyp©jkyb`              #  Get the lowercase Corpus alphabet
                           pu)           #  Plus the uppercase Corpus alphabet
  i                                      #  Add Z at the end (index -1)
Source Link
Kamil Drakari
  • 4.4k
  • 11
  • 21

Japt, 47 bytes

;
`…ypetjkŠkp¡okrtyp©jkyb`
C+B
£WøX ?Vpu gWbX:X

Try it online!

The above link includes most test cases, but I haven't been able to input the second to last one as a string because it contains both single and double quotes. Here is that test case, input as an array of characters instead.

Explanation:

;                           #Use the alternate values for variables C and B

`…ypetjkŠkp¡okrtyp©jkyb`    #V = "atypetjkitkpstokrtyputjkyb"

C+B                         #W = lowercase alphabet + uppercase alphabet

£                           #For each character X in the input: 
 WøX ?                      # If it is in W
           WbX              #  Get the index in W
          g                 #  And replace X with the character at that index in
      Vpu                   #  V + uppercased V
              :X            # Otherwise leave X as-is