Skip to main content
Commonmark migration
Source Link

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

vim gif

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

vim gif

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

vim gif

+gif
Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

vim gif

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

vim gif

explanation
Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much

Vim, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Vim + coreutils, 42 bytes

i1⏎12<Esc>qqYp$ylp<C-a>q6@qggqqjYpv$!rev⏎kJd2lq7@q

Try it online!

Ungolfed/Explanation

i1⏎12<Esc>                                          " start with lines 1,12 in the buffer
          qq           q6@q                         " record macro and run it 6 times:
            Yp                                      "  - duplicate line
              $ylp                                  "  - duplicate last character
                  <C-a>                             "  - increment it
                           gg                       " go to the beginning (buffer is now: 1,12,123,...,12..89)
                             qq               q7@q  " record macro and run it 6 times:
                               jYp                  "  - go to line below and duplicate it
                                  v$!rev⏎           "  - mark it and reverse it
                                         kJ         "  - join the line above with the current one
                                           d2l      "  - remove the space and character that are too much
Source Link
ბიმო
  • 16.9k
  • 2
  • 41
  • 104
Loading