젤리 , 15 14 13 바이트 13 자
2X
s⁵µ¢1¦ṫ¢µ€
TryItOnline!
이러한 청크가있는 경우 마지막 1-9의 문자를 포함하여 10 개의 문자 중 첫 번째 문자를 바꾸거나 제거합니다. 문자의 작은 부분 집합 중에서 선택합니다 : 1; 2.
어떻게?
2X - Link 1, flip a coin: no arguments
X - random choice from
2 - 2 (treated as the integers [1,2])
s⁵µ¢1¦ṫ¢µ€ - Main link: string of printable ASCII
s⁵ - split (s) into chunks of size ten (⁵)
µ µ - monadic chain separation
€ - for each chunk
¢ - last link as a nilad
1¦ - apply to index 1 (replace 1st of the 10 char chunk with the chosen integer)
¢ - last link as a nilad
ṫ - tail - if it was 1 this has no effect (50%)
- if it was 2 this discards the replaced character (50%)
- implicit print
인쇄 가능한 ASCII의 모든 아니라 단지에 비해 선택할 수있는 1과 2(아직 교체 또는 각 청크의 첫 번째 문자 제거) 21 바이트를 :
s⁵µ32r126¤ỌX¤1¦ṫ2X¤µ€
A의 완전 임의 버전 I 30 바이트 (아마도 최적이 아닌)가 (50/50 제거는 /, 균일 한 랜덤 인쇄 가능한 ASCII, 및 각 청크 내에서 균일하게 임의의 문자 위치를 대체)
95R+31ỌX;
s⁵µṙ⁵X¤©Ṗ2X¤Ŀṙ®C¤µ€
이렇게하면 각 청크가 임의의 양만큼 왼쪽으로 회전하고 마지막 문자가 튀어 나온 다음 처음 두 링크 중 하나가 비어 있고 다른 하나는 인쇄 가능한 임의의 ASCII 문자와 연결됩니다. 그런 다음 청크를 다시 회전시킵니다.