11
Challenge:
Read input (within visible ASCII range) and output with a few modifications:
- In each set of 10 characters of the input randomly (50/50):
- replace one character* (with a random** one within visible ASCII range) (ex.
lumberjack
becomeslumbeZjack
) - or remove one character (ex.
lumberjack
becomeslmberjack
)
- replace one character* (with a random** one within visible ASCII range) (ex.
* If the set is of less than 10 characters, you don't have to modify it, but you can.
** The character can be the same as the one input, as long as it's still random.
Example:
Input: Go home cat! You're drunk!
Output: Go hom cat! YouLre drunk!
(just a example, since output could be random, don't use as a test case)
Rules:
- code-golf, least characters wins!
5
@n4melyh4xor also you could post future challenges on the Sandbox. There you will get some feedback about your challenge.
– Rod – 2016-12-16T16:57:58.2731What if the replacement char is the same as the char to be replaced? – Brad Gilbert b2gills – 2016-12-16T17:16:30.997
@BradGilbertb2gills, I'm not that picky, it's fine. – n4melyh4xor – 2016-12-16T17:21:14.850
Closely related – AdmBorkBork – 2016-12-16T17:27:26.137
Does the index of the character to be replaced have to be random? – Yytsi – 2016-12-30T22:43:56.507
Does it have to be uniformly random, or just each character just need a non-zero chance of appearing? – FlipTack – 2016-12-31T12:44:19.537
Is the input guaranteed to be at least 10 characters long? – FlipTack – 2016-12-31T13:45:01.993
@FlipTack "If the set is of less than 10 characters, you don't have to modify it, but you can." I would interpret that as a no. – Yytsi – 2016-12-31T20:09:52.147