Skip to main content
Notice removed Reward existing answer by naffetS
Bounty Ended with Aiden Chow's answer chosen by naffetS
Notice added Reward existing answer by naffetS
Bounty Started worth 100 reputation by naffetS
Notice removed Reward existing answer by Adám
Bounty Ended with RGS's answer chosen by Adám
Notice added Reward existing answer by Adám
Bounty Started worth 100 reputation by Adám
All the solutions are already assuming the string contains *only* lowercase letters, but this should be made unambiguous.
Source Link

Given a string that contains only lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) Example: 8 5 12 12 15
  2. Pad each number to two characters with 0s. Example: 08 05 12 12 15
  3. Join. Example: 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

Given a string that contains lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) 8 5 12 12 15
  2. Pad each number to two characters with 0s. 08 05 12 12 15
  3. Join. 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

Given a string that contains only lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) Example: 8 5 12 12 15
  2. Pad each number to two characters with 0s. Example: 08 05 12 12 15
  3. Join. Example: 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

Tweeted twitter.com/StackCodeGolf/status/792240960365268992
deleted 8 characters in body
Source Link
Oliver Ni
  • 10.7k
  • 4
  • 42
  • 110

Given a string that contains lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) 8 5 12 12 15
  2. Pad each number to two characters with the appropriate number of 0s. 08 05 12 12 15
  3. Join. 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

Given a string that contains lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) 8 5 12 12 15
  2. Pad each number with the appropriate number of 0s. 08 05 12 12 15
  3. Join. 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

Given a string that contains lowercase letters, encode that string with the alphabet cipher.

To encode with the alphabet cipher (I will be using the example hello):

  1. First, convert each letter in the string to a number depending on its position in the alphabet (a = 1, b = 2, etc.) 8 5 12 12 15
  2. Pad each number to two characters with 0s. 08 05 12 12 15
  3. Join. 0805121215

Test cases

helloworld -> 08051212152315181204 codegolf -> 0315040507151206 alphabetcipher -> 0112160801020520030916080518 johncena -> 1015081403051401 

Remember, this is , so the code with the fewest number of bytes wins.

edited tags
Link
xenia
  • 8.2k
  • 2
  • 29
  • 59
Source Link
Oliver Ni
  • 10.7k
  • 4
  • 42
  • 110
Loading