(Inspired by this challenge)
Given two input strings, one of which is exactly one character longer than the other, arrange the strings into ASCII art as if they are two halves of a zipper that is only halfway zippered. The longer word forms the bottom of the zipper, and is the first and last character of the combined zippered portion. Since that paragraph is hard to understand, take a look at some examples:
zippered
paragraph
z
i
p
p
gerraepdh
a
r
a
p
Note how paragraph
(the longer word) forms the bottom zipper, and the g r a p h
portion encapsulates the e r e d
portion of zippered
, and the z i p p
and p a r a
portions are offset from each other.
Input
- Two ASCII strings in any convenient format, with one guaranteed to be even in length and the other exactly one character longer.
- Neither string will contain whitespace, but may contain any other printable ASCII value.
- You can take the input in either order. Please state in your submission the input order.
Output
The resulting ASCII art representation of the zippered words, as described above, again in any convenient format.
Rules
- Leading or trailing newlines or whitespace are all optional, so long as the characters themselves line up correctly.
- Either a full program or a function are acceptable. If a function, you can return the output rather than printing it.
- If possible, please include a link to an online testing environment so other people can try out your code!
- Standard loopholes are forbidden.
- This is code-golf so all usual golfing rules apply, and the shortest code (in bytes) wins.
Examples
ppcg
tests
p
p
sctgs
e
t
string
strings
s
t
r
iinnggs
r
t
s
one guaranteed to be even in length and the other exactly one character longer.
The shorter string is always even \$\endgroup\$