Skip to main content
added 13 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Jelly, 12 12 9 bytes

⁵ṁX€’©+OỌ,®Y⁵ṁX€’Ṅ+OỌ

Try it online!Try it online!

How it works

⁵ṁX€’©+OỌ,®Y⁵ṁX€’Ṅ+OỌ  Main link. Argument: s (string)

⁵             Set the return value to 10.
 ṁ            Mold; create an array of 10's with the length of s.
  X€          Pseudo-randomly pick a integer between 1 and 10, for each 10.
    ’         Decrement, so the integers fall in the range [0, ..., 9].
     ©        CopyPrint the resultkey, toas thean registerarray, followed by a linefeed.
      +O      Add the integers to the ordinals (code points) of s.
        Ọ     Unordinal; convert back to characters.
         ,®   Pair the result with the key.
           Y  Join, separating by a linefeed.

Jelly, 12 bytes

⁵ṁX€’©+OỌ,®Y

Try it online!

How it works

⁵ṁX€’©+OỌ,®Y  Main link. Argument: s (string)

⁵             Set the return value to 10.
 ṁ            Mold; create an array of 10's with the length of s.
  X€          Pseudo-randomly pick a integer between 1 and 10, for each 10.
    ’         Decrement, so the integers fall in the range [0, ..., 9].
     ©        Copy the result to the register.
      +O      Add the integers to the ordinals (code points) of s.
        Ọ     Unordinal; convert back to characters.
         ,®   Pair the result with the key.
           Y  Join, separating by a linefeed.

Jelly, 12 9 bytes

⁵ṁX€’Ṅ+OỌ

Try it online!

How it works

⁵ṁX€’Ṅ+OỌ  Main link. Argument: s (string)

⁵             Set the return value to 10.
 ṁ            Mold; create an array of 10's with the length of s.
  X€          Pseudo-randomly pick a integer between 1 and 10, for each 10.
    ’         Decrement, so the integers fall in the range [0, ..., 9].
             Print the key, as an array, followed by a linefeed.
      +O      Add the integers to the ordinals (code points) of s.
        Ọ     Unordinal; convert back to characters.
added 621 characters in body
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Jelly, 12 bytes

⁵ṁX€’©+OỌ,®Y

Try it online!Try it online!

How it works

⁵ṁX€’©+OỌ,®Y  Main link. Argument: s (string)

⁵             Set the return value to 10.
 ṁ            Mold; create an array of 10's with the length of s.
  X€          Pseudo-randomly pick a integer between 1 and 10, for each 10.
    ’         Decrement, so the integers fall in the range [0, ..., 9].
     ©        Copy the result to the register.
      +O      Add the integers to the ordinals (code points) of s.
        Ọ     Unordinal; convert back to characters.
         ,®   Pair the result with the key.
           Y  Join, separating by a linefeed.

Jelly, 12 bytes

⁵ṁX€’©+OỌ,®Y

Try it online!

Jelly, 12 bytes

⁵ṁX€’©+OỌ,®Y

Try it online!

How it works

⁵ṁX€’©+OỌ,®Y  Main link. Argument: s (string)

⁵             Set the return value to 10.
 ṁ            Mold; create an array of 10's with the length of s.
  X€          Pseudo-randomly pick a integer between 1 and 10, for each 10.
    ’         Decrement, so the integers fall in the range [0, ..., 9].
     ©        Copy the result to the register.
      +O      Add the integers to the ordinals (code points) of s.
        Ọ     Unordinal; convert back to characters.
         ,®   Pair the result with the key.
           Y  Join, separating by a linefeed.
Source Link
Dennis
  • 210.6k
  • 41
  • 370
  • 825

Jelly, 12 bytes

⁵ṁX€’©+OỌ,®Y

Try it online!