Write a program or function that transforms an input string into Zalgo text.
For example, for an input string Zalgo
, a possible output might look like:
Z̗̄̀ȧ̛̛̭̣̖̇̀̚l̡̯̮̠̗̩̩̥̭̋̒̄̉̏̂̍̄̌ģ̨̭̭̪̯̫̒̇̌̂o̢̟̬̪̬̙̝̫̍̈̓̅̉̇
Zalgoification specs
- Each letter (upper or lower case) must be zalgoified, and nothing else (spaces, punctuation).
- The combining characters that can be placed on letters here are all those between U+0300 ̀ and U+032F ̯
- Each letter must have a total number of combining characters on it (above and under combined) which is randomly chosen according to a normal distribution of mean 10 and standard deviation 5 (If a negative number is chosen, 0 combining characters must be added).
- Each combining character placed on a letter is chosen uniformly at random between the 48 possible combining characters (see 2nd item).
Inputs, Outputs
- Input is a single line string that contains only characters between ASCII 32 (space) and ASCII 126 (tilde). No line breaks. You may assume there is at least one letter in the string. The input can be taken as command line argument, function parameter, or STDIN.
- Output is the Zalgoified string. It can be written to a file, or printed to STDOUT, or returned from a function. A trailing line feed is fine. The output doesn't have to display properly in your interpreter/whatever, as long as when you copy it to a Stack Exchange answer it displays properly like here.
Test cases
- The Zalgo example above.
- Input:
Programming Puzzles & Code Golf
Possible output:
P̢̭̟̟̮̍̅̏̍̀̊̕̚̚r̢̫̝̟̩̎̔̅̈̑o̡̠̣̪̠̍̈̐̏̌̆g̡̬̯̟̠̩̎̐́̅̚ȑ̢̨̩̠̙̭̤̩̟̔̕ą̟̟̯̠̪̜́̉̒̎̂̍̃́̚̚̚m̪̈̅̈m̨̛̛̪̤̟̔̍̓i̢̛̬̠̠̇̈̂̓̒̀̋̔̚̚n̛̝̩̜̓̐̑̅̅g̨̩̪̊ P̨̧̢̟̙̮̋̆ų̨̙̞̙̫̤̫̭̊̓̒̃̒̚z̜̤̮̪̫̄̌̃̈̉̑̋́̕z̡̥̯̠̬̜̥̑̌̓̌̋́̅ľ̫̙̟̪̖̉ė̢̨̘̦̘̖s̛̜̙̘̚ & C̨̠̟̯̟̙̠̉̄̄́̄̑̈̔̆̀ö̭̟̗̯̥̏̐̄̏̌d̞̬̀̆́̀é̟̙̩̗̙̣̋̎̌̌̋ Ğ̨̡̧̡̣̪̝̝̘̩̮̉̋̀̉̉̕̕ọ̠̠̘̟̑̇́̀̃̎̓̋̚ḽ̡̢̟̪̥̍̍̅̀́̎̆̕f̧̢̪̠̠̀̉̒̍̍̊́
- Input:
Golf is a club and ball sport in which players use various clubs to hit balls into a series of holes on a course in as few strokes as possible.
Possible output:
Ǧ̡̧̄̐̊ò̡̞̟̖̌́̄́̆̈̒l̡̬̣̜̫̞̘̪̇̈̏̊̆̃̑̉̓̒f̙̐̍̇́̐̍̉ į̦̘̝̣̊̒̎̚s à̡̛̠̜̙̣̙̞̣̗̯̝̘̩̅̊̓̄̒̃ ć̬̗̫̯̫̎́̚l̒̎̋ű̯̜̑̎b̯̣̮̭̤̃̊́ a̡̨̟̘̭̣̍̈̀̃̎́̐̋̆̂ń̨̖̭̝̬̘̦̣̓̇̚̕d̨̤̣̙̜̪̖̪̍̓̔̍̔̃̒̍̆̏̚̚̕̚ ḃ̬̪̇̕a̡̟̖̬̬̖̬̋́̎̎̔̄̏̒̑̚l̨̖̜̬̠̭̭̇l̡̡̛̛̬̤̆̔̑̍ s̠̙̣̠̖̜̜̅p̤̖̃́̅̕̕ǫ̢̥̬̠̞̭̭̘̟̞̋̊̌r̡̛̞̬̈̇̑̎̄̚t̟̩̏̀ ï̡̧̢̨̜̜̝̝̜̜̫̔̇̂̔̐n̞̖̫̪̟̤̦̫̂̓̍̑̆̒̚ w̨̧̟̠̯̜̙̘̏̎̈̆̂̅̔hi̧̝̖̗̖̒̆̆̈̚ć̪̜̫̖̠̣̞̋̈́̀̌̋h̢̢̨̥̮ p̜̣̋̔̆l̨̧̛̘̫̝̙̠̯̂̑̌̈̒̐ā̩̗̟̐ẏ̢̛̫̠̦̤̫̞̦̯̥̜̀̀̈̅̉̈̄ẹ̡̑̔̄̉̀̎̒̑r̛̫̭̤̋̄̓̀̅̓ș̜̯̆̋̒̍̔ ų̛̘̭̜̝̈̃̂̅̌̍̆̚s̡̡̡̨̫̥̪̋̈̀̀̆ê̢̡̡̥̖̮̞̫̪̥̘̥̯̎́ v̡̢̢̟̠̞̬̥̩̣̫̫̦̞̂̐̓̇ặ̢̧̙̝̥̪̗̆̎̓ŗ̦̙̩̑̒̕í̫̣̊̚ō̡̧̤̘̟̩̠̫̗̃̍̉̊̕ụ̡̪̠̈̈́̊̅s̢̢̘̤̝̪̀̎̅ c̡̢̛̖̫̗̑̒̆́̎̚l̥̥̖̘̉̎̓̔̀̔ų̘̘̣̟̃̆̓̉̏̅̓̂́̇b̡̝̗̙̗̮̖̩̗̦̏̌̏š̛̮̣̮̜̒̓̌ ṭ̣̫̗̮̙̈̔̅̂̎̃̌̈ò̮̘̍̅̃̃̅̚̕ ḩ̜̞̮̠̇i̮t̝̗̦̖̮̞̗̩̞̤̎̍̒̐ bȁ̢̮̩̝̣̉ļ̛̮̘̏ĺ̨̖̮̑s̢̬̪̗̬̖̟̅̀ i̢̗̖̊̃ń̨̧̛̫̮̞̎t̡̗̞̩̙̑̐̏̔̏ơ̧̯̮̦̖̇̆̔ ạ̧̉̍̚ s̤̬̫̠̉e̎̃r̟̪̥̗̜̥̍̆̍̇̕̕i̧̧̭̝̫̪̯̖̞̪̅̇̎̈̐̅̍ȇ̟̬́̄̃̐̊̕s̢̢̛̝̤̙̭̘̩̩̍̑̂̈̀̀̍̄̔̒̒ o̡̢̘̩̣̅̐̆̌̂̉̇̆̋̕f̡̯̜̝̘̮̠̖̐̂̒̃̚̕ h̪̘̫̪́ǫ̭̦̔̋̆̚̕l̢̡̧̨̙̯̤̔̅̓̆̑̍́ȅ̪̬̝̙̅̋̍s̪̖̭̫̪̟̖̐̀̕ ǫ̦̠̫̍̊̉̄̚n̐̎̂̀ ą̡̛̛̤̦̪̣̭̈̐̂̎ c̪̩̠̗̟̜̘̐̂̈̐̑̏̈ọ̡̡̙̫̞̜̐̇̄̓̏u̥̖̙̝̔̂̎̅̚̚r̙̜̬̭̠̮̙̙̪̫̝̙̬̥̥̯̐́̈́̊̈̍̍ș̀́e̞̜̒̌̚ ĩ̧̦̝̪̆n̛̞̞̆̆̀ a̟̅̐̈̍̉̚̚̕ş̫̭̍̐̚ f̘̝̠̪̦̜́̌̍̇̀̕e̩̫̣̊̎̇̚w̪ ŝ̨̨̠̠̝̦̣̜̦̗̮̞̞̥̥̅̄̄̕t̢̡̢̙̞̟̩̭̤̅̎̌̒̃̇̕r̞̤̙̄̊̃̇̅̈̏̈̌ǫ̝̬̀̋̏̐̌̈k̡̢̧̪̭̝̙̆̈̒̀ȩ̛̙̣̠̗̞̮̅̅s̙̣̒̉̎́̂̅ à̧̛̖̘̞̫̘̎̃̀̑̎̕̕s̢̟̟̭̩̈̏̇ p̣̟̭̗̪̜̫̦̝̣̎̋̎̀̐̏o̧̢̪̮̤̦̎́̐̒̀̚̕s̛̯̦̗̬̬̊̊̄̓̐̉̏́̚s̢̠̣̬̥̬̔̅̕̕i̡̠̣̣̫̞̣̮̥̟̅̎̇̄̋̌̌̇b̡̧̡̖̖̃̄̋̈̋l̢̢̙̪̣̉̉̐̑̆ẹ̢̒̎.
Scoring
This is code-golf, so the shortest answer in bytes ẁ̨̛̭̙̥̖̏̏̐̐̉̃̅̚i̜̟̭̤̞̘̗̐̐̔̈̍̋̏̚n̘̯̥̩̗̯̠̘̮̋̈̃̀̊̉̎̈̕s̛̬̦̙̮̩̜̄̑̐́̎̆̚.