Hacker News new | past | comments | ask | show | jobs | submit | tlent's comments login

As someone who also completed Advent of Code in Rust this year this was very interesting. I agree it is a great way to learn more about a new language. Thanks for sharing!

It seems like we ran into a lot of the same pain points like parsing, lack of a min-heap, etc.

Regarding HashMap initialization the best way I'm aware of to do what you are looking for is with lazy_static[0]. Maybe not very clean or idiomatic though.

For sorting I found the best solution to that problem was using sort_by_key with a tuple like (a.year, a.month, a.day, a.hour, a.minute).

[0]: https://github.com/rust-lang-nursery/lazy-static.rs#example


Would it be possible to use the much cheaper Raspberry Pi Zero W instead of the 3?


To quote from the slides (Jan 8): https://web.stanford.edu/class/cs140e/notes/lec1/slides.pdf Slide 3:

"A modern approach

- Multicore, 64-bit ARMv8 platform.

- Modern programming languages and tools."

The Raspberry Pi Zero W does not support 64 bit mode, since it uses a BCM2835 instead of a BCM2837. Even more: the BCM2835 does not even support ARMv7 instructions (only ARMv6).


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: