this post was submitted on 23 Jun 2023
9 points (100.0% liked)
Code Golf
172 readers
1 users here now
Icon base by Delapouite under CC BY 3.0 with modifications to add a gradient
founded 1 year ago
MODERATORS
you are viewing a single comment's thread
view the rest of the comments
view the rest of the comments
Just discovered this community existed, I've got to make a post in my usual golfing lang:
Zsh, 70 bytes
Try it online!
The key constructs here are
(l.ARITHMETIC EXPRESSION.)
, which left-pads, and$^l
, which expands the array like a cross product.a=(a b c); echo x$a
printsxa b c
, butecho x$^a
printsxa xb xc
.Interestingly,
print -l
was shorter than<<<
by one byte.