MaliciousKebab@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-29 months agoWhat could go wrong trying to solve AoC in Rust?sh.itjust.worksimagemessage-square17fedilinkarrow-up172arrow-down16file-text
arrow-up166arrow-down1imageWhat could go wrong trying to solve AoC in Rust?sh.itjust.worksMaliciousKebab@sh.itjust.works to Programmer Humor@programming.devEnglish · edit-29 months agomessage-square17fedilinkfile-text
minus-squareGeniusIsme@lemmy.worldlinkfedilinkarrow-up2·9 months agoShow the alternative, I’ll have a good laugh.
minus-squarejanAkali@lemmy.onelinkfedilinkEnglisharrow-up1·edit-29 months agoIt’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
minus-squareGeniusIsme@lemmy.worldlinkfedilinkarrow-up1·9 months agoAhh, 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.
Show the alternative, I’ll have a good laugh.
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
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.