Skip to main content
Post Reopened by Magic Octopus Urn, jacksonecac, edc65, bren, Blue
Post Closed as "Needs details or clarity" by Level River St, Martin Ender
Tweeted twitter.com/StackCodeGolf/status/801103541230338048
added 7 characters in body
Source Link
jacksonecac
  • 2.6k
  • 15
  • 29

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a randompseudo-random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a pseudo-random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

added 2 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he


This is so the shortest code wins! Good Luck and have fun!

added 2 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135

Generate a cipher given a number and string

Input:

integer n in the range of 0 <= n <= 9
string s phrase to encrypt in the cipher

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable asciiASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Example:Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he

 

This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Input:

integer n in the range of 0 <= n <= 9
string s phrase to encrypt in the cipher

Your task is simple. Given a string s and number n as inputs, insert a random printable ascii character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he

This is so the shortest code wins! Good Luck and have fun!

Generate a cipher given a number and string

Your task is simple. Given a string s and a number 0 <= n <= 9 as inputs, insert a random printable ASCII character between each character of the string n times. Such that for each character of s there are n random characters between them. Spaces should be trimmed.

Input:

  • string s phrase to encrypt in the cipher
  • integer n in the range of 0 <= n <= 9

Example:

Input:

The treasure is here
2

Output:

T!0h32eF4t0irlkehma7ys#0u*&r*he!2iH^sB,h!@e0)r$he

 

This is so the shortest code wins! Good Luck and have fun!

edited tags
Link
Martin Ender
  • 197.2k
  • 67
  • 447
  • 975
Loading
added 2 characters in body
Source Link
mbomb007
  • 23.5k
  • 7
  • 63
  • 135
Loading
deleted 1 character in body
Source Link
jacksonecac
  • 2.6k
  • 15
  • 29
Loading
the code itself isn't restricted to printable ASCII
Source Link
user62131
user62131
Loading
grammar + md
Source Link
TuxCrafting
  • 4.8k
  • 3
  • 33
  • 46
Loading
Source Link
jacksonecac
  • 2.6k
  • 15
  • 29
Loading