Code Monkey home page Code Monkey logo

pyeuler's Introduction

= Introduction

http://projecteuler.net/

Project Euler is a website dedicated to a series of computational problems intended to be solved with computer programs. The project attracts adults and students interested in mathematics and computer programming. Here we will solve them using Python with purely functional programming style. 

Some people have expressed their concerns about making the solutions of the Euler Project public. While the risk of having people using them unjustly certainly exists (shame on them), the benefits of sharing knowledge should exceed this petty inconvenient.  

= On functional programming

If "functional programming" sounds unfamiliar to you, read these pages and discover this exciting paradigm:

http://en.wikipedia.org/wiki/Functional_programming
http://linuxgazette.net/109/pramode.html
http://www.ibm.com/developerworks/library/l-prog.html
http://www.amk.ca/python/writing/functional

Python is not a purely functional language, so some (many, I am afraid) of these solutions won't be as pythonic as one would like. But this is the challenge: solve the Euler Project problems using pre FP, state variables are absolutely forbidden!

If you are a Python novice this is probably not the best place to start. But if you already are familiar with Python and want to explore its functional possibilities, it may be interesting.

= Get the solutions

To check the correctness of the solutions we can download a text file from this project (not related to pyeuler):
 
    $ wget http://projecteuler-solutions.googlecode.com/svn/trunk/Solutions.txt  

= Run the problems
    
    $ python pyeuler/run.py --solutions-file Solutions.txt 
    1: 233168 (ok)
    2: 4613732 (ok)
    ...
    
    $ python pyeuler/run.py --solutions-file Solutions.txt {1..3} 5 
    1: 233168 (ok)
    2: 4613732 (ok)
    3: 6857 (ok)
    5: 232792560 (ok)

pyeuler's People

Contributors

tokland avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.