ûèB☼å°╤
Run and debug it st staxlang.xyz!
Unpacked (8 bytes) and explanation:
m|RFNppz
m For each line of input:
|R Run-length encode: "heeeello" -> [[104,1],[101,4],[108,2],[111,1]]
F For each pair:
N Uncons-left: [104,1] -> push [104]; push 1
ppz Pop and print. Pop and print. Push "".
Implicit print (always an empty string) with a newline
5 bytes, works only on a single line:
∩l↨me
|RmEp] Unpacked
|R Run-length encode: "heeeello" -> [[104,1],[101,4],[108,2],[111,1]]
m Map block over input:
E Explode array: [104,1] -> push 104, push 1
p Pop and print with no newline
] Make a one-element list: 104 -> [104] (which is "h")
Implicit print with newline
Run and debug it at staxlang.xyz!
Perhaps not legal. This program prints each pair on a line of its own. A bit sketchy.
If that output format is illegal, I give you 6 bytes:
╡δôZ→╬
|RFEp]p Unpacked
F For each item in array, execute block:
p Pop and print with no newline
No implicit print in for-each block, so no extra newlines
Run and debug it at staxlang.xyz!
The language's creator recursive points out that uncons-right (N
) can shorten this to six bytes unpacked, as it handles the E
and the ]
on its own. Programs this short, however, often get no shorter when packed, and this is am example. Still six bytes: |RFNpp
Edit: Had to update my main answer; this form is what I used.
w4orld
instead of1w4o1r1l1d
(you'd need to escape numerics, e.g. `f111 -> f3\1´). But then it would be a near-duplicate of this: codegolf.stackexchange.com/questions/6774 \$\endgroup\$ – primo Sep 14 '12 at 9:5422
is a trivial fixpoint. \$\endgroup\$ – Peter Taylor Sep 17 '12 at 18:1511
is impossible.22
must end there or be followed by another fixed point not beginning with2
.333nnn
is an impossible pattern, for you'll never find the same character at consecutive odd indices.4444
and up fail for the same reason. \$\endgroup\$ – Khuldraeseth na'Barya Aug 5 '19 at 21:26