this post was submitted on 01 Feb 2024
65 points (91.1% liked)

Programmer Humor

18961 readers
511 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 1 year ago
MODERATORS
 
you are viewing a single comment's thread
view the rest of the comments
[–] [email protected] 2 points 6 months ago (1 children)

Show the alternative, I'll have a good laugh.

[–] [email protected] 2 points 6 months ago* (last edited 6 months ago) (1 children)

It's Nim, but I have no idea why you can't do this in Rust:

var seeds = lines[0].split(": ")[1].splitWhitespace().mapIt(it.parseInt)

Full solution: https://codeberg.org/Archargelod/aoc23-nim/src/branch/master/day_05/solution.nim

[–] [email protected] 1 points 6 months ago

Ahh, it is the same thing. Rust example surely has some cruft, but mostly for the better. I'm sure not all of it is needed.