Find file History
Permalink
..
Failed to load latest commit information.
001.rb Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
002.c Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
003.cpp Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
004.asm Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
005-interpreter.pl Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
005.bf Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
006-gen.pl Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
006.ws Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
007.mps Problem 7 (MUMPS): Find the 10001st prime. Feb 8, 2009
008.vim Problem 17 (inform7): Number letter counts Aug 31, 2014
009.lol Problem 9 (LOLcode): Find the only Pythagorean triplet, {a, b, c}, fo… Dec 10, 2008
010.sml Implemented a truer version of the Sieve for 10. Dec 13, 2008
011.sh Problem 11 (Bash): What is the greatest product of four numbers on th… Dec 14, 2008
012.pro Problem 12 (Prolog): What is the value of the first triangle number t… Jun 27, 2009
013.lua Problem 13 (Lua): Find the first ten digits of the sum of one-hundred… Jul 4, 2009
014.xml Whoops; replaced $x with a real value in 014.xml comments. Aug 1, 2009
014.xsl Problem 14 (XSLT): Find the longest sequence using a starting number … Aug 1, 2009
015.cob Problem 15 (COBOL): Starting in the top left corner in a 20 by 20 gri… Sep 8, 2012
016.pas Problem 16 (Pascal): Power digit sum Aug 30, 2014
017.ni Wow, turns out problem 17 doesn't need any of this stuff Jan 12, 2016
067.hs Renamed polyglot solution set to heteroglot, which is far more approp… Dec 3, 2008
Makefile Fix compilation of problem 17, and remove useless status line change Jan 12, 2016
README.md Problem 17 (inform7): Number letter counts Aug 31, 2014

README.md

This is a set of Project Euler solutions in which no programming language is used twice.

Each program begins with a comment containing the entire problem description. When run, each program prints the solution and a single newline to standard output.

Programs are each a single source file named nnn.ext. (Unless they're not — see XSLT.) Most can be compiled/run by giving the filename to a standard compiler/interpreter. For esoteric runtimes (consider vimscript), the source may contain brief instructions on how to get the code to run, but this is only done when absolutely necessary.

Note that when it matters, a POSIX-compatible shell is assumed, because I'm running Linux.

Rules

The rules are loose and entirely subject to my interpretation, but I try to stick to the following:

  • Languages may not be reused. Variants are generally avoided, but the ultimate guideline is whether the result would be interesting.

  • Languages shall be chosen without regard for the requirements of the next problem. Ideally, I should have no idea what the next problem even is.

  • Trivial transformational scripts (in any language) are allowed in extreme cases if a language is particularly difficult to read or write. This exception exists solely for Whitespace.

  • Programs must perform the actual calculation. The general pattern is that any numbers or other parameters that appear in the problem are defined as constants within the program; changing the constants thus ought to produce the appropriate answer. (Programs are not, however, expected to deal with excessively large or malformed parameters.)

Languages used

  • Problem 1: Ruby
    Add all the natural numbers below one thousand that are multiples of 3 or 5.

  • Problem 2: C
    By considering the terms in the Fibonacci sequence whose values do not exceed four million, find the sum of the even-valued terms.

  • Problem 3: C++
    Find the largest prime factor of a composite number.

  • Problem 4: x86 assembly
    Find the largest palindrome made from the product of two 3-digit numbers.

  • Problem 5: Brainfuck
    What is the smallest number divisible by each of the numbers 1 to 20?

  • Problem 6: Whitespace
    What is the difference between the sum of the squares and the square of the sums?

  • Problem 7: MUMPS
    Find the 10001st prime.

  • Problem 8: vimscript
    Discover the largest product of five consecutive digits in the 1000-digit number.

  • Problem 9: LOLcode
    Find the only Pythagorean triplet, {a, b, c}, for which a + b + c = 1000.

  • Problem 10: Standard ML
    Calculate the sum of all the primes below two million.

  • Problem 11: Bash
    What is the greatest product of four adjacent numbers on the same straight line in the 20 by 20 grid?

  • Problem 12: Prolog
    What is the value of the first triangle number to have over five hundred divisors?

  • Problem 13: Lua
    Find the first ten digits of the sum of one-hundred 50-digit numbers.

  • Problem 14: XSLT
    Find the longest sequence using a starting number under one million.

  • Problem 15: COBOL
    Starting in the top left corner in a 20 by 20 grid, how many routes are there to the bottom right corner?

  • Problem 16: Pascal
    Power digit sum

  • Problem 17: Inform7
    Number letter counts

  • ...

  • Problem 67: Haskell
    Using an efficient algorithm find the maximal sum in the triangle?

Declared unusable

For posterity, the following languages have been attempted in the past, but have been ruled unusable by executive decree.

  • Malbolge

Links