Skip to main content
Source Link
user41805
  • 13.2k
  • 6
  • 42
  • 88

\L, \U, \E for fractals in GNU sed

The case switching special sequences help in "toggling" a line. An example is the following challenge to produce a fractal X on anagol, whose shortest sed solution by mitchs et al is reproduced here.

s/^/X\n/
:
s/^.\{,27\}\n/&\L&\U&/mg
//s/[ X]/& &/g
s/x/ X /g
t

Try it online!

If the fractal uses another character to fill it, then at the end you can add a transliterate.

Post Made Community Wiki by user41805