15
Write a program that takes an input string of length 2 or more characters and adds the string ~BOO!~
(that string has a leading and ending space) in a uniformly random spot in the string that is not on either end.
Disallowed sample inputs: 2
or
(an empty input)
Disallowed sample outputs: Hello ~BOO!~
or ~BOO!~ Hello
for the input Hello
Sample input: Hello, World!
Sample outputs: Hel ~BOO!~ lo, World!
or Hello, Worl ~BOO!~ d!
This is code golf, fellas. Standard rules apply. Shortest code in bytes wins.
Congratulations to Dennis for having the shortest, spookiest program! Happy Halloween!
Would a command-line argument be okay, or does it have to be stdin? – DLosc – 2015-10-31T02:51:14.343
Anything that takes an input and prints that output with the modification is acceptable. I use STDIN by default because it's the only term I'm familiar with. – Arcturus – 2015-10-31T02:57:17.383