Skip to main content
deleted 50 characters in body
Source Link
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352

Vim, 1818, 17 bytes

lqqyljvPkvPll@qq@qqqyljvPkvPll@qq@q 

Try it online!Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right  qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 

Vim, 18 bytes

lqqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right  qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 

Vim, 18, 17 bytes

qqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

 qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 
deleted 34 characters in body
Source Link
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352

VimVim, 18 bytes

lqqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 

Vim, 18 bytes

lqqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 

Vim, 18 bytes

lqqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop 
Source Link
DJMcMayhem
  • 60.1k
  • 18
  • 203
  • 352

Vim, 18 bytes

lqqyljvPkvPll@qq@q 

Try it online!

This uses the V interpreter because of backwards compatibility. Input comes in this format:

string1 string2 

Explanation:

l " Move one character to the right qq " Start recording in register 'q' yl " Yank one letter j " Move down a row vP " Swap the yanked letter and the letter under the cursor k " Move back up a row vP " Swap the yanked letter and the letter under the cursor ll " Move two letters to the right. This will throw an error once we're done @q " Call macro 'q' recursively q " Stop recording. @q " Start the recursive loop