К основному контенту

Сообщения

Сообщения за декабрь, 2020
  My version of ed Golf that I stumbled upon recently. Same conditions here. File 'start' contains one line of 'abcdefg'. We need to create a spaced letterbox out of it, like this: a b c d e f g b           f c           e d            d e            c f            b g f e d c b a   Here we go:   $ ed start 8 ,p abcdefg #### GOLF STARTS HERE ### ### 4 - copy current (first) line. Current line is now line 2 .t. ### 20 - "shift left" whole line 2 s#\(.\)\(.*\)#\2\1# ### (4+2) x 5 = 30 - repeat process until first letter is 'g' ### duplicate current line and set 'dot' to it .t. ### 's' without arguments repeats last substitution command s .t. s .t. s .t. s .t. s ### 30 - cut out unneeded letter in the middle of letterbox 2,6s#^\(.\).*\(.\...