Code Monkey home page Code Monkey logo

frankkair / polyglot-euler Goto Github PK

View Code? Open in Web Editor NEW
73.0 8.0 14.0 656 KB

๐Ÿ“œ Project Euler solutions in various programming languages

License: MIT License

Rust 7.77% Ruby 11.78% Swift 5.95% Elixir 21.52% Erlang 1.87% Crystal 4.36% JavaScript 1.32% OCaml 1.30% Python 12.97% Go 3.71% C++ 2.75% Lua 2.93% Scala 1.65% Java 1.21% Haskell 9.85% Clojure 5.96% D 0.86% C 1.73% Perl 0.39% Julia 0.12%
project-euler euler-solutions rust ruby elixir swift crystal erlang javascript python golang scala haskell lua java dlang euler programming-language typescript ocaml

polyglot-euler's Introduction

Polyglot Euler

Project Euler solutions in different programming languages.

  • C
  • C++
  • Clojure
  • Coconut
  • Crystal
  • D
  • Elixir
  • Erlang
  • F#
  • Futhark
  • Go
  • Groovy
  • Haskell
  • Java
  • JavaScript
  • Julia
  • Lua
  • Objective-C
  • OCaml
  • Python
  • Perl
  • Red
  • Ruby
  • Rust
  • Scala
  • Scheme
  • Shell
  • Swift
  • TypeScript
  • Zig

Contributing and adding new problems

Check our CONTRIBUTING.md for guidelines.

Run ruby scripts/add_new_problem.rb to add a new problem to the project.

For more info, click here.

polyglot-euler's People

Contributors

caiangums avatar caiopo avatar cesarbess avatar douglasgimli avatar ernulphus avatar frankkair avatar fredericojordan avatar hugoferreira avatar lucaspbordignon avatar murilocamargos avatar sudo-nice avatar yvern avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

polyglot-euler's Issues

REPL links for easy testing

How do you guys feel towards adding some REPL.it links on each problem's description?

For those who aren't familiar with it, it provides an online REPL for most popular languages (Elixir not included ๐Ÿ˜’), with the option of storing code with a permalink (example).

This functionality would provide an easy and quick platform for testing/debugging/optimization purposes without the hassle of having to set up the language environment.

One of the only downsides I can think of is having to update these snippet links whenever we make changes to our solutions. I don't know if there's a way of loading the code from this repo every time the link is loaded, but that would neatly solve this problem.

Should I add multiple Elixir solutions?

Hey guys! It's me again! :)
I've just recently completed the first 50 Euler problems in Elixir. I just wanted to know if I should flood this repo with more Elixir code or not.
I think I recall a Python PR for the first 50 problems being rejected on the grounds of too much code at once, but I can't seem to find it. I did find #2 that included the first 20, though.
Anyways, let me know if it's a good addition! Thanks!

ps.: @FrankKair add me to your friend list! 1303129_5SgMVy96F4dFfIXvahxjTAPc4J70lbr1

Create CONTRIBUTING.md to give some instructions

It would be a nice idea if this project has a CONTRIBUTING.md file to guide some newcomers (as me ๐Ÿ˜ )

I think on something about this topics:

  • Structure of PR naming
  • Structure of branch naming (maybe too much?)
  • Structure of commit messages in order to create some log of what problems and what language it was solved
  • On each PR, create some description to describe your way of thinking (as example, I posted on page 9 on Project Euler forum as user caiangums)

Can we discuss about this?

Agnostic Omniscience Profiler

Would be interesting to see comparisons between different versions automagically.

For example: the current solution to 001 with list comprehensions in contrast to a generator expression

# current
print(sum([n for n in range(1000) if n % 3 == 0 or n % 5 == 0]))

# new
print(sum(n for n in range(1000) if n % 3 == 0 or n % 5 == 0))

Storing a README in each subdirectory with the current stats (cpu time and memory consumption) would be nice.

Project Stats / Data Science

Hello, Eulerians

We could have a "data science" section in the README (the place doesn't actually matter) to showcase some statistics about the project, such as:

Problems

  • How many problems were solved;
  • Which problem has the most solutions.

Languages

  • How many programming languages;
  • Which language has the most solutions;
  • Which language has to fastest average time.

Something along these lines.
Does that sound nice to you people? Any other suggestions?

Create most used functions lib

There's a lot of problems in Project Euler that relies on the same kind of operations, e.g., prime testing, prime generator, fibonacci sequence, and so on. It would be nice to have these kind of functions in file shared by all solutions as a lib.

What you guys think about that?

Scala Code Golf

object Main {
def solve(): Int = {
(0 to 999).filter((x) => ((x % 3) == 0 || (x % 5) == 0)).sum
}
def main(args: Array[String]): Unit = {
val result = solve()
println(result)
}
}

Can be rewritten as:

object P1 extends App {
  println((0 to 999).count(x => Seq(3, 5).exists(x % _ == 0)))
}

Optimize Elixir solution 145

Hey guys, I've just opened #33 which consists of the elixir solution for problem 145.
Unfortunately it is very badly optimized for now, taking 30 min to compute.
If anybody has any suggestion for improvement, I'd be happy to test it out! ๐Ÿ˜„
Thanks!

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.