#adventOfCode day 2,
- in #LuaLang, https://gitlab.cs.washington.edu/fidelp/advent-of-code-2025/-/blob/main/02.lua
- Desktop: 365 ms
- Raspberry Pi 2B: 18.5 sec
- in C, https://gitlab.cs.washington.edu/fidelp/advent-of-code-2025/-/blob/main/02.c
- Desktop: 46 ms
- Raspberry Pi 2B: 2.2 sec
Implementing a naive algorithm was fine, albeit a little slow on the Pi. Retro platforms will struggle with this one unless I come up with a better solution using numerical methods. Maybe I'll have something for the TI-92+ tomorrow. I'm sure it could handle the example input in Lua, but I want to do better than that.
The Raspberry Pi 2B uses a quad-core Cortex-A7 at 900 MHz. In 2016 this was my all-purpose "desktop" machine used for all tasks. The same Pi is still in service as my web server hosting my website and music. http://edlinfan.duckdns.org/music.html
[~] time ./02
Part A, B = 19219508902, 27180728081
real 0m2.188s
user 0m2.180s
sys 0m0.000s
[~] cat /sys/firmware/devicetree/base/model
Raspberry Pi 2 Model B Rev 1.2
[~] head -n 4 /proc/cpuinfo
processor : 0
model name : ARMv7 Processor rev 4 (v7l)
BogoMIPS : 57.60
Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32

