My solutions to Project Euler problems in multiple languages https://euler.oliviaappleton.com/
  • Python 21.8%
  • C 14.3%
  • Rust 12.6%
  • JavaScript 9.5%
  • Fortran 8.6%
  • Other 33.2%
Find a file
2026-01-10 21:33:46 -06:00
.github/workflows Update python.yml 2026-01-10 21:33:46 -06:00
_data Solve p85 in python (86th solved!); minor docs changes 2024-10-21 17:03:55 -05:00
c Solve p22 in fortran; fix comments 2024-10-07 16:36:52 -05:00
cplusplus Solve p22 in fortran; fix comments 2024-10-07 16:36:52 -05:00
csharp Fix build issues from ubuntu upgrade (2) 2025-02-04 16:04:44 -06:00
docs Switch fediverse handle 2025-02-21 11:49:24 -06:00
fortran fix p20 2024-10-11 23:22:43 -05:00
java More Makefile compression 2024-09-26 13:15:10 -05:00
javascript More Makefile compression 2024-09-26 13:15:10 -05:00
lua Solve p19 in lua 2024-10-15 13:06:55 -05:00
python Bug found! 3.12.8 had a breaking change to tee() behavior 2025-01-08 11:47:00 -06:00
rust Another attempt at wasm (5) 2025-01-23 16:36:50 -06:00
.codecov.yaml Attempt fortran code coverage 2024-09-19 14:20:46 -05:00
.gitattributes add metadata, fix c coverage in Makefile 2024-08-16 11:27:01 -05:00
.gitignore Solve p20 in fortran, lua; revert vale 2024-10-11 16:51:32 -05:00
.gitmodules Fix up submodules 2024-08-02 13:34:30 -05:00
.luacheckrc add custom global 2024-09-10 22:49:40 -05:00
.stignore Continue csharp port 2024-06-25 15:17:11 -05:00
LICENSE Update license, makefiles + read files from uri 2024-08-10 01:20:10 -05:00
Makefile Attempt to compress/futureproof global Makefile 2024-09-26 12:48:56 -05:00
README.rst Remove GraalPy from Python support due to failing build image 2026-01-09 21:58:18 -06:00

Olivia's Project Euler Solutions
================================

.. |Ci| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/c.yml?logo=github&label=C%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/c.yml
.. |C-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/c-lint.yml?logo=github&label=Linting
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/c-lint.yml
.. |Cpi| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/cplusplus.yml?logo=github&label=Cpp%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/cplusplus.yml
.. |Cp-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/cplusplus-lint.yml?logo=github&label=Linting
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/cplusplus-lint.yml
.. |C#i| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/csharp.yml?logo=github&label=C%23%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/csharp.yml
.. |C#-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/csharp-lint.yml?logo=github&label=Linting
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/csharp-lint.yml
.. |Fri| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/fortran.yml?logo=github&label=Fr%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/fortran.yml
.. |Javai| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/java.yml?logo=github&label=Java%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/java.yml
.. |Java-lint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/java-lint.yml?logo=github&label=Linting
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/java-lint.yml
.. |JavaScript| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/javascript.yml?logo=github&label=Js%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/javascript.yml
.. |ESLint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/eslint.yml?logo=github&label=ESLint
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/eslint.yml
.. |Luai| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/lua.yml?logo=github&label=Lua%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/lua.yml
.. |LuaCheck| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/lua-lint.yml?logo=github&label=LuaCheck
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/lua-lint.yml
.. |Python| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/python.yml?logo=github&label=Py%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/python.yml
.. |PythonLint| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/python-lint.yml?logo=github&label=Linting
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/python-lint.yml
.. |Rust| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/rust.yml?logo=github&label=Rs%20Tests
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/rust.yml
.. |RustClippy| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/rust-clippy.yml?logo=github&label=Clippy
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/rust-clippy.yml
.. |CodeQL| image:: https://img.shields.io/github/actions/workflow/status/LivInTheLookingGlass/Euler/codeql.yml?logo=github&label=CodeQL
   :target: https://github.com/LivInTheLookingGlass/Euler/actions/workflows/codeql.yml
.. |C-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=C&logo=codecov&label=C%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=C
.. |Cp-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Cpp&logo=codecov&label=Cpp%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Cpp
.. |Cs-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Csharp&logo=codecov&label=C%23%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Csharp
.. |Ja-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Java&logo=codecov&label=Java%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Java
.. |Js-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=JavaScript&logo=codecov&label=Js%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=JavaScript
.. |Lu-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Lua&logo=codecov&label=Lu%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Lua
.. |Py-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Python&logo=codecov&label=Py%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Python
.. |Rs-Cov| image:: https://img.shields.io/codecov/c/github/LivInTheLookingGlass/Euler?flag=Rust&logo=codecov&label=Rs%20Cov
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler?flags%5B0%5D=Rust
.. |br| raw:: html

  <br/>

.. |gcc| replace:: ``gcc``
.. |clang| replace:: ``clang``
.. |flang| replace:: ``flang``
.. |ifx| replace:: ``ifx``, & ``ifort``
.. |msvc| replace:: ``msvc``
.. |nvf| replace:: ``nvfortran``
.. |pcc| replace:: ``pcc``
.. |tcc| replace:: ``tcc``

.. |nbsp| unicode:: \u200B
   :trim:

.. table::
   :class: datatable

   +------------+----------------------------+--------+-------------------+
   | Language   | Version                    | Solved | Status            |
   +============+============================+========+===================+
   | C          | C99+ in: |clang|, |br|     | 25     | |Ci| |br|         |
   |            | |gcc|, |pcc|, & |tcc| |br| |        | |C-Cov| |br|      |
   |            | C11+ in: |msvc| [1]_       |        | |CodeQL| |br|     |
   |            | |br| Browser [2]_          |        | |C-lint|          |
   +------------+----------------------------+--------+-------------------+
   | C++        | C++98+ in: |br| |clang|, & | 22     | |Cpi| |br|        |
   |            | |gcc| |br|                 |        | |Cp-Cov| |br|     |
   |            | C++14+ in: |msvc| [1]_     |        | |CodeQL| |br|     |
   |            | |br| Browser [3]_          |        | |Cp-lint|         |
   +------------+----------------------------+--------+-------------------+
   | C |nbsp| # | .NET 2+                    | 22     | |C#i| |br|        |
   |            |                            |        | |Cs-Cov| |br|     |
   |            |                            |        | |CodeQL| |br|     |
   |            |                            |        | |C#-lint|         |
   +------------+----------------------------+--------+-------------------+
   | Fortran    | Fortran 95+ in |gcc|, |br| | 22     | |Fri|             |
   |            | |flang|, |nvf|, |br| |ifx| |        |                   |
   +------------+----------------------------+--------+-------------------+
   | Java       | Java 8+ in Corretto, |br|  | 22     | |Javai| |br|      |
   |            | Dragonwell, Liberica, |br| |        | |Ja-Cov| |br|     |
   |            | Microsoft, Oracle, |br|    |        | |CodeQL| |br|     |
   |            | Semeru, Temurin, & Zulu    |        | |Java-lint|       |
   +------------+----------------------------+--------+-------------------+
   | JavaScript | Node 12+ |br|              | 34     | |JavaScript| |br| |
   |            | Bun 1.0+ |br|              |        | |Js-Cov| |br|     |
   |            | Browser [#]_               |        | |CodeQL| |br|     |
   |            |                            |        | |ESLint|          |
   +------------+----------------------------+--------+-------------------+
   | Lua        | PUC-Rio Lua 5+ [#]_        | 23     | |Luai| |br|       |
   |            |                            |        | |Lu-Cov| |br|     |
   |            |                            |        | |LuaCheck|        |
   +------------+----------------------------+--------+-------------------+
   | Python     | CPython 3.6+ |br|          | 86     | |Python| |br|     |
   |            | Pypy 3.6+ |br|             |        | |Py-Cov| |br|     |
   |            | Browser [#]_               |        | |CodeQL| |br|     |
   |            |                            |        | |PythonLint|      |
   +------------+----------------------------+--------+-------------------+
   | Rust       | Rust 1.69+ |br|            | 44     | |Rust| |br|       |
   |            | Browser [#]_               |        | |Rs-Cov| |br|     |
   |            |                            |        | |RustClippy|      |
   +------------+----------------------------+--------+-------------------+

.. |test-c-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-c.html" target="_blank">click here!</a>

.. |test-cp-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-cp.html" target="_blank">click here!</a>

.. |test-cs-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-cs.html" target="_blank">click here!</a>

.. |test-ja-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-ja.html" target="_blank">click here!</a>

.. |test-js-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-js.html" target="_blank">click here!</a>

.. |test-lu-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-lu.html" target="_blank">click here!</a>

.. |test-py-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-py.html" target="_blank">click here!</a>

.. |test-rs-link| raw:: html

   <a href="https://euler.oliviaappleton.com/_static/test-rs.html" target="_blank">click here!</a>

.. [1] This is the earliest standard the MSVC explicitly supports.
.. [2] While these solutions do run in most browsers, they need to be bundled with Emscripten first,
   and these tests not yet automated as in |clang| and |gcc|. To run these tests yourself, |test-c-link|
   Note that this is an in-progress feature, and some solutions do not work under WebAssembly
.. [3] While these solutions do run in most browsers, they need to be bundled with Emscripten first,
   and these tests not yet automated as in |clang| and |gcc|. To run these tests yourself, |test-cp-link|
   Note that this is an in-progress feature, and some solutions do not work under WebAssembly
.. [#] While these solutions do run in most browsers, they need to be bundled with WebPack 5.93+ & Babel 7.25+ first,
   and these tests not yet automated as in Nodejs and Bun. To run these tests yourself, |test-js-link|
.. [#] Mostly due to difficulty testing against older versions
.. [#] While these solutions do run in most browsers, they need to be bundled with Pyodide 0.26.2+ first, and these
   tests are not yet automated as in CPython and pypy. To run these tests yourself, |test-py-link|
.. [#] While these solutions do run in most browsers, they need to be bundled with wasm-pack 0.2+ first, and these
   tests are not yet automated as on non-web platforms. To run these tests yourself, |test-rs-link|
.. .. [#] (This target is not yet complete.) While these solutions do run in most browsers, they need to be bundled with DotNetAnywhere first,
..    and these tests not yet automated as in mainline .NET. To run these tests yourself, |test-cs-link|
.. .. [#] (This target is not yet complete.) While these solutions do run in most browsers, they need to be bundled with CheerpJ first,
..    and these tests not yet automated as in mainline Java. To run these tests yourself, |test-ja-link|
.. .. [#] (This target is not yet complete.) While these solutions do run in most browsers, they need to be bundled with Fengari-web first,
..    and these tests not yet automated as in mainline Lua. To run these tests yourself, |test-lu-link|

Coverage
--------
.. image:: https://codecov.io/github/LivInTheLookingGlass/Euler/graphs/icicle.svg?token=6GHBNILEHG
   :target: https://app.codecov.io/github/LivInTheLookingGlass/Euler

This is the repository I keep for prospective employers to look at
project Euler code that I have written.

This is useful because it has defined problems and answers such that you
can compare answers with other people.

All solutions are tested against multiple operating systems and
language/compiler versions. For more information, see
``.github/workflows/``

This is NOT meant to help others on Project Euler problems
----------------------------------------------------------

If you are working on Project Euler problems, DO NOT use this as a source
-------------------------------------------------------------------------

The repo is divided into sections for each language. The top-level
Makefile will direct recipes using prefixes

-  ``make c_*`` will go to the c Makefile
-  ``make cp_*`` will go to the csharp Makefile
-  ``make cs_*`` will go to the csharp Makefile
-  ``make docs_*`` will go to the docs Makefile
-  ``make fr_*`` will go to the fortran Makefile
-  ``make ja_*`` will go to the java Makefile
-  ``make js_*`` will go to the javascript Makefile
-  ``make lu_*`` will go to the lua Makefile
-  ``make py_*`` will go to the python Makefile
-  ``make rs_*`` will go to the rust Makefile
-  Any make recipes supported by Sphinx will be redirected to the docs Makefile
-  All other recipes will be run for all languages

For more information, please see the README documents in each section.