Coder Social home page Coder Social logo

projecteuler's Introduction

Project Euler Solutions

Solutions to the Project Euler problems in various programming languages.

Unless noted otherwise in the language sections, every solution should be:

  • General - supports calculations for an arbitrary input parameter
  • Fast - when possible, does not resort to brute force techniques
  • Self-contained - no 3rd party or non-standard library usage
  • Clear - employs good software engineering practices and language idioms

Currently implemented problems:

  • C - 170 problems
  • Python - 1 problem

Performance report

You can generate a simple performance comparison report of the used languages by running:

./performance_report.sh

The script will print the number of executed solutions and their total running time for each language.

Build instructions and language notes

c/ subdirectory --- C11/POSIX

An example of a barebones, compiled, procedural language approach.

Build by running make from the top of the c/ directory tree

make build      // default, compiles all binaries
make all        // compiles binaries and also runs tests
make tests      // runs all tests
make debug      // compiles all binaries with debugging information
make verify     // performs dynamic verification using the valgrind's memcheck tool
make clean      // deletes compilation related generated files
make distclean  // deletes all generated files
make tags       // creates a single ctags database with symbol lookups
Limitations

Does not check for numeric overflows, consequently a number of the solutions will produce incorrect answers for very large input parameters

python/ subdirectory --- Python 3.5

An example of a rich-featured, interpreted, object-oriented language approach.

The top of the python/ directory tree should be in PYTHONPATH

make tests      // runs all tests
make verify     // pylint the source code
make clean      // deletes compilation related generated files
make distclean  // deletes all generated files
make tags       // creates a single ctags database with symbol lookups

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.