Euler Companion (Unofficial)
Solve Project Euler without leaving VS Code. Read a problem, write your solution beside it, run it,
submit your answer, and watch your solved list fill in.
Unofficial VS Code extension, built with the site in mind: Euler Companion is an independent unofficial extension published with the consent of the official Project Euler team. The Project Euler team knows how it uses the site and has consented to its use with it signing in, syncing and submitting answers. It has no AI features: it never
suggests, computes or looks up an answer. Your solutions and answers are your own.
Branding
- Icon: eiπ, from Euler's identity eiπ + 1 = 0. A cream e with a
gold exponent on a navy tile.
- Sidebar: the same e with a dot in place of the exponent, drawn in one colour so it follows
your theme.
- Colours: navy
#1d2a3d, cream #f2ead9, gold #e7a93c.
- Lettering: EB Garamond Italic, under the SIL Open Font License, converted to outlines.
The artwork is original to this extension and does not use Project Euler's logo.
What it does
Problem list in the sidebar. Click the Euler icon in the Activity Bar. The Problems
view has four groups:
- In Progress: problems you have a Solution File for but have not solved.
- All: every problem, in number order.
- Recent: the ten newest problems.
- Solved: the problems you have solved.
The header shows your progress, for example 12 / 1020 solved.
Read a problem. Click a problem, or run Euler: Open Problem… and type a number or part of
a title. The problem opens in its own tab with the maths typeset, and stays readable offline.
Create a Solution File. Use the </> button on a problem, or Euler: Create Solution File.
You get one Python or JavaScript file per problem in your Solutions Folder, opened next to the
problem, with the problem text in its header. Any data files the problem needs are saved in the
folder's data/ subfolder.
Run your solution. Click ▷ Run Solution above the first line of the file, or the ▷ button
in the editor's title bar. The output appears in the Euler Companion output panel. Print your
answer as the last line.
Submit your answer. After a clean run, click Submit this answer in the notification, or
click Submit Answer above the file at any time. You see the exact answer that will be sent and
confirm it once; the extension sends it once and tells you whether it was right. A correct answer
marks the problem solved. After a wrong answer, the next submission waits 60 seconds.
Your solved list, in sync. Once you are signed in, the sidebar picks up the problems you have
solved on projecteuler.net by itself, and the Sync button in the Problems view updates it
whenever you like. Offline, Mark as Solved and Mark as Unsolved (right-click a problem) set
it by hand. Your files are never moved, renamed or edited.
Getting started
- Install the extension and click the Euler icon in the Activity Bar.
- Click Sign In in the Problems view. A separate browser window opens on Project Euler's
sign-in page. Sign in there as usual; the window closes by itself when you are done.
- Open a problem and create its Solution File. The first time, choose where your solutions live:
~/project-euler or any folder you pick. This is saved as eulerCompanion.solutionsFolder in your
user settings.
You need Python 3 (python3, or python on Windows) or Node.js on your PATH to run solutions, or
set your own command (see Settings). Signing in needs Chrome, Edge, Brave or Chromium installed.
Everything except Sync and Submit also works without signing in.
Settings
| Setting |
Default |
What it does |
eulerCompanion.solutionsFolder |
(asked on first use) |
Absolute path of the folder for your Solution Files. ~ means your home folder. Only user settings can change it, not a project's settings. |
eulerCompanion.language |
python |
Template for new Solution Files: python or javascript. |
eulerCompanion.runCommand |
[] |
Command for Run Solution, as a list of arguments, e.g. ["pypy3", "${file}"]. ${file} and ${problem} are replaced. It is run directly, never through a shell, and is ignored in untrusted workspaces. |
eulerCompanion.runTimeoutSeconds |
60 |
Stop a running solution after this many seconds (1–3600). |
eulerCompanion.browserPath |
"" |
The browser to sign in with, if it isn't found automatically: path to Chrome, Edge, Brave or Chromium. |
Signing in and out
You sign in yourself, in a separate browser window that the extension opens with a fresh, empty
profile. The extension never sees your password or the CAPTCHA, and never reads cookies from your
everyday browser. Once you are in, it keeps only Project Euler's two session cookies, closes the
window and deletes that temporary profile.
To sign out, run Euler: Sign Out. It uses the site's own sign-out form, then deletes the
stored cookies; they are deleted even if the site can't be reached. You can also remove the
persistent login from your Account page on projecteuler.net.
Privacy and network use
Where requests go
The extension talks only to https://projecteuler.net. There is no telemetry and no other host.
| When |
What |
| You first open the sidebar or Open Problem…, then at most once a day, or when you click Refresh |
/minimal=problems, the public problem list |
| You open a problem for the first time |
/minimal=N, the public problem text, plus any images it shows |
| You create a Solution File for a problem with data files |
the linked /resources/documents/... files |
| Right after you sign in, to check it worked |
/minimal=connected, which replies with your username |
| You click Sync; or, at most once an hour, when you first open the sidebar in a window or have just signed in |
/minimal=solved, the list of problems you have solved. Only if that list is empty: /minimal=connected, to tell "nothing solved" from "signed out", then /about if that is empty too |
| You submit an answer |
/problem=N, then one post of its answer form. If the page has no answer form, /minimal=solved instead, to check whether you have already solved it |
| You sign out |
/about, then one post of its sign-out form |
Requests are spaced at least 1.5 seconds apart within a window, never run in parallel, and carry a
User-Agent that names this extension. Cookies are sent only with the signed-in requests in the last
four rows. Problem text, images and the list are kept locally, so problems you have opened work
offline. The Euler Companion Log output panel lists each request (for example GET /problem=3)
and each result, but never your username, cookies, tokens, answers or your list of solved problems.
Your programs' output has its own panel, Euler Companion, so the two never mix.
What is stored, and where
| What |
Where |
| Your Solution Files and downloaded data files |
Your Solutions Folder and its data/ subfolder |
| The Solutions Folder path and other settings |
VS Code user settings |
Your solved list (eulerCompanion.progress) |
VS Code extension storage (globalState). It is not synced by Settings Sync. |
| The cached problem list, problem text and images |
The extension's private storage folder (globalStorage) |
Session cookies: __Host-PHPSESSID and, if you ticked Remember Me, keep_alive |
VS Code SecretStorage, which uses your operating system's keychain. Your password is never seen or stored. |
| When the 60-second wait after a wrong answer ends |
VS Code extension storage, plus a cooldown file in the private storage folder so other windows see it at once |
session.lock, present only while a signed-in request runs, so two windows never use the session at once |
The extension's private storage folder |
The extension never writes a submitted answer to disk. The output of Run Solution goes to the
Euler Companion output panel, which VS Code keeps in its own log files.
Safety
- Problem pages run no scripts. The text is cleaned against a short list of allowed tags and
shown with scripts disabled and a strict Content Security Policy.
- Your code runs only when you ask, only in a trusted workspace, as a single process without a
shell, and is stopped at the time limit.
- Answers are sent only when you confirm them, exactly as shown, once, with no automatic retry.
- Nothing is downloaded at runtime. The extension never downloads code or a browser.
Keep your solutions private
Project Euler asks members not to publish solutions. In its words, members who publish solutions to
problems beyond the first 100 "will have their accounts locked". Solution Files for problems above
100 carry a reminder. Think before putting your Solutions Folder in a public repository.
Licence and attribution
The extension is MIT licensed (see LICENSE).
Problem text comes from Project Euler and is licensed under
CC BY-NC-SA 4.0. Each problem tab and
Solution File shows "Problem N from Project Euler, CC BY-NC-SA 4.0" with a link to the problem.
Problem text is shown for your personal, non-commercial use; bonus problems and member statistics
are never shared.
Maths is typeset with KaTeX (MIT). The icon's lettering is EB Garamond
(SIL Open Font License).
| |