ProjectEulerSolutions
Solutions to some problems on https://projecteuler.net/archives
I’m building this repository as I go, mostly as a convenience to myself so I can push and pull from work and home.
Solutions are assorted in Python and C. I started with Python since I was more familiar with it, but now I’m working to translate everything to C. It really forces you to think up more efficient solutions :)
Some python solutions I had to remove since they don’t work in Python 3 anymore. Most were easy to update, but a few I couldn’t figure out.
Improving organization of these day by so apologies if it’s not up to snuff! The binaries included were compiled on Debian so sorry, Windows users.
I extensively use libgmp in the C examples, because handling large integers as I’ve found out, is a pretty difficult task. It wouldn’t make sense for me to try and re-invent the wheel!
The docs aren’t too bad, you can find them here:
https://gmplib.org/manual/index.html
PLEASE do not use these solutions to cheat through the site! These are only provided as resource for you to read when you get stuck, you do not need to copy my solutions. Please re-write my solutions in another language. Or if you can’t, at least go and retype each line, renaming the variables so they make sense to you (I was kind of deliberately cryptic). Or even better, write a prettier solution! Some these are kind of inelegant. They get the job done but…
- UPDATE: now with assembly (NASM) examples! I did cheat a bit by stealing C’s printf function since writing numbers can be a pain. See the Makefile for each example for instructions on how to build. I’m still new to assembly so the code is not optimized, but I tried to opt for more readability where I could