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

Programmer Humor

19512 readers
459 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
 

signal-2024-02-01-19-47-41-855

you are viewing a single comment's thread
view the rest of the comments
[–] GeniusIsme@lemmy.world 2 points 9 months ago (2 children)

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

[–] janAkali@lemmy.one 2 points 9 months ago* (last edited 9 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

[–] GeniusIsme@lemmy.world 1 points 9 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.