Coder Social home page Coder Social logo

euler-cl's Introduction

Project Euler in Common Lisp

CircleCI Matrix Static Badge Static Badge

euler-cl logo

Solutions to Project Euler problems in Common Lisp - currently only tested against SBCL.

Organisation

The sources (solutions) can be found in the src directory.

Naturally each solution is paired with a test suite with the same name under the tests directory.

How To Run and Test

euler-cl's build is facilitated by GNU Make.

To Run

Simply run make run to execute all the solutions and view the answers in a nicely tabulated format.

For example:

 ┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓ 
 ┃                        PROJECT EULER ANSWERS                         ┃
 ┣━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━┫ 
 ┃ PROBLEM #  ┃              ANSWER              ┃      TIME (µs)       ┃ 
 ┣━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━┫ 
 ┃          1 │                          233,168 │                   63 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          2 │                        4,613,732 │                    2 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          3 │                            6,857 │                  212 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          4 │                          906,609 │              205,373 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          5 │                      232,792,560 │                   50 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          6 │                       25,164,150 │                    2 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          7 │                          104,743 │               24,250 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          8 │                   23,514,624,000 │                  992 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
 ┃          9 │                       31,875,000 │                    5 ┃ 
 ┠────────────┼──────────────────────────────────┼──────────────────────┨ 
...

To Test

Simply run make test to launch all test suites.

For example:

Running test suite UTILS-TEST-SUITE
 Running test HASH-TABLE-MERGE ......
 Running test STRING-TO-LIST ....
 Running test STRING-TO-INTEGER-LIST ....
 Running test INTEGER-TO-LIST ...
 Running test INTEGER-TO-ARRAY .....
 Running test PRIMEP ..........
 Running test MAPMAX ....
 Running test SUM-OF-DIVISORS .........
 Running test HASH-TABLE-EQUAL-P ......
 Running test VECTOR-TO-HASH-TABLE ....
Running test suite P1-TEST-SUITE
 Running test MULTIPLE-OF-3-OR-5P ....
 Running test SOLUTION* ....
 Running test SOLUTION ....
Running test suite P2-TEST-SUITE
 Running test SOLUTION .....
Running test suite P3-TEST-SUITE
 Running test SOLUTION* ...
 Running test SOLUTION ...
Running test suite P4-TEST-SUITE
 Running test PALINDROMIC-NUMBERP ......
 Running test MAX-PALINDROMIC-PRODUCT ..
 Running test SOLUTION ..
Running test suite P5-TEST-SUITE
 Running test PRIME-FACTORS .......
 Running test LCD ..........
 Running test SOLUTION ....
Running test suite P6-TEST-SUITE
 Running test SUM-1-TO-N ....
 Running test SUM-SQUARED-1-TO-N ....
 Running test SOLUTION ....
Running test suite P7-TEST-SUITE
 Running test NTH-PRIME ......
 Running test SOLUTION ......
...

Dependencies

The makefile is designed in a way that whenever you run one of the targets (eg run or test), it ensures the dependencies are/get installed.

The only thing you'd need to install is Quicklisp.

euler-cl's People

Contributors

bahmanm avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

euler-cl's Issues

Integate with Codecov

  1. Use SBCL sb-cover to generate HTML reports.
  2. Write a Perl program to parse the HTML documents using HTML::Tree and extract the coverage data.
  3. Write the coverage data to a single coverage.txt in Go format.

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.