euler is a command line tool for running and
submitting Project Euler problems. Go here to see what
it looks like when you submit a successful problem:
I've submitted it to Macports, but in the meantime you need to do a little bit of work to get started. You need the jp2a, ImageMagick and BeautifulSoup libraries installed.
$ sudo port install jp2a ImageMagick py27-beautifulsoup
Then grab the euler script (just one file) and place it somewhere in your
euler requires two pieces of information from you: the number of the
problem you are trying to solve, and your proposed solution. You can do this in
one of a few ways:
Submit a problem number and a problem file.
eulerwill run the problem file and treat the first line of output as the solution.
$ euler -p 22 problem22.py $ euler -p 17 myjavasolution.java
Submit a problem number and a solution.
$ euler -p 14 -s 24289 $ euler --problem 11 --solution 242113
Pipe the solution to Project Euler.
Here you go, fancy pants:
$ perl problem240solution.pl | euler -p 240
This assumes that your file will output the solution as the first argument to stdout.
You can also save your username and password in a file named
.eulerrc in your home directory (
/Users/yourusername/.eulerrc). The format is:
[login] username = myusername password = mypassword
Note that there are no quotes around your username or password.
Here are the languages currently supported by
C C++ Haskell Java Python Ruby
If your language isn't supported, you can pipe a solution in via stdin:
$ sml problem4.sml | euler -p 4
Or specify your solution as another argument on the command line:
$ euler -p 4 -s 99032
Pull requests to add new languages are also welcome.