day 4 rewritten in C

gitlab.cs.washington.edu/fidel

This is a very simpleminded solution with no algorithmic fanciness: it's performing lots of repeated work in Part B.

  • PC - 1 ms
  • Raspberry Pi 2: 23 ms
  • Plus: 10 seconds

It was stunning to see a result returned in just 10 seconds on the , rather than minutes for previous days. The performance difference between an interpreter and an optimizing compiler is stark! Also, the TI-92 doesn't have a floating-point coprocessor, which makes Lua in particular struggle to run at speed.

TI-92+ graphing calculator displaying:
Part A: 1451
Part B: 8701
0

If you have a fediverse account, you can quote this note from your own instance. Search https://oldbytes.space/users/psf/statuses/115663739730504191 on your instance and quote it. (Note that quoting is not supported in Mastodon.)