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
EDIT: Damn, lemmy still mangles code. Here's a gist, and I'll replace the text in here with images.
This doesn't beat anyone's char count, but here's my try in Factor. I hope someone comes along and does it even better. 177 chars (1 line):
You prefix the number to that code to invoke.
Here it is with the slight bit of sanity afforded by line breaks and a function wrapper:
To invoke:
EDIT 2: it's 176 if you replace
first2
withlast2
, as someone pointed out to me.