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

Programmer Humor

19623 readers
113 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
[โ€“] [email protected] 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 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.