Comments on Weave Strings Together
Parent
Weave Strings Together
Given a list of strings(and optionally, their length) as input, weave the strings together.
Intro
Your goal is to mimic the WV
operator in Pip. Take a list of strings and alternate between their characters like so:
hello,
world, → hwc,eoo,lrd,lle,od → hwceoolrdlleod
code
Effectively, you need to group the characters at each index, and join them into a single string.
The strings may have spaces.
No truncation should be done, and all the characters of each string must be used.
Test Cases
["kino","cinema","movie"] → kcmiionnvoeimea
["code","golf"] → cgoodlef
["Hi","","There"] → HTihere
["Explanation"] → Explanation
["Dyalog APL","Cultivation","Orchard"] → DCOyuralclthoiagvr adAtPiLon
You check any other test cases with this program.
[Jelly], 2 1 byte Z …
3y ago
[APL (Dyalog Unicode)], 10 byt …
4y ago
Risky, 1 byte 0? Try …
3y ago
[Haskell], 40 bytes ```hask …
4y ago
Japt `-P`, 7 2 bytes Õc …
4y ago
Scala, 60 bytes ```scala .ma …
3y ago
[Ruby], 51 bytes ```ruby - …
3y ago
[Python 2], 58 54 bytes ``` …
3y ago
[Python 3], 72 69 bytes ``` …
3y ago
BQN, 8 bytesSBCS ``` ∾⊒˜¨⊔ …
3y ago
[JavaScript (Node.js)], 53 byt …
4y ago
Ruby, 48 45 bytes ```ruby …
3y ago
[Python 3], 91 90 bytes Sav …
3y ago
Post
Jelly, 2 1 byte
Z
-1 byte thanks to Razetime!
Full program
How it works
Z - Main link. Takes a list L on the left
Z - Transpose
Implicitly print, smashing lists together to form one string
1 comment thread