All Projects → Encrylize → EasyEuler

Encrylize / EasyEuler

Licence: MIT License
A command line tool for Project Euler

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to EasyEuler

HackerrankJAVA
This repository consists of Hackerrank JAVA Solutions
Stars: ✭ 31 (+6.9%)
Mutual labels:  challenges, problems
rot13
This is a collection of ROT13 encoding programms written in different languages. Just for fun.
Stars: ✭ 24 (-17.24%)
Mutual labels:  challenges
desafios flutterando
Repositório destinado aos desafios proposto pela comunidade Fluterando.
Stars: ✭ 33 (+13.79%)
Mutual labels:  challenges
emsm
A lightweight, easy to extend minecraft server manager.
Stars: ✭ 72 (+148.28%)
Mutual labels:  cli-app
touch-bar
Launch the macOS Touch Bar simulator from the command-line
Stars: ✭ 43 (+48.28%)
Mutual labels:  cli-app
jira-cli
🔥 [WIP] Feature-rich interactive Jira command line.
Stars: ✭ 809 (+2689.66%)
Mutual labels:  cli-app
AIODrive
Official Python/PyTorch Implementation for "All-In-One Drive: A Large-Scale Comprehensive Perception Dataset with High-Density Long-Range Point Clouds"
Stars: ✭ 32 (+10.34%)
Mutual labels:  challenges
duolingo-solution-viewer
A browser extension providing access to the lists of solutions to the translation / listening challenges on Duolingo, and restoring the correction of typos for listening challenges.
Stars: ✭ 31 (+6.9%)
Mutual labels:  challenges
codewars-python
No description or website provided.
Stars: ✭ 20 (-31.03%)
Mutual labels:  challenges
2048.c
CLI version of 2048, written in C.
Stars: ✭ 14 (-51.72%)
Mutual labels:  cli-app
budget-cli
Manage your Google budget spreadsheets from terminal.
Stars: ✭ 30 (+3.45%)
Mutual labels:  cli-app
malli-cli
Command-line interface from the comfort of a metosin/malli schema
Stars: ✭ 36 (+24.14%)
Mutual labels:  cli-app
exch
a command-line tool to see currency exchange rates
Stars: ✭ 20 (-31.03%)
Mutual labels:  cli-app
CodeSignal-Solutions
CodeSignal solutions
Stars: ✭ 112 (+286.21%)
Mutual labels:  challenges
monoreact
📦 React workspaces implementation
Stars: ✭ 13 (-55.17%)
Mutual labels:  cli-app
Voila
Voila is a domain-specific language launched through CLI tool for operating with files and directories in massive amounts in a fast & reliable way.
Stars: ✭ 78 (+168.97%)
Mutual labels:  cli-app
teks
Easily get custom go template based outputs to your command-line tool. Like in docker/kubernetes
Stars: ✭ 41 (+41.38%)
Mutual labels:  cli-app
LiteOTP
Multi OTP Spam Amp/Paralell threads
Stars: ✭ 50 (+72.41%)
Mutual labels:  cli-app
Typon
A multi-featured typing practice tool that runs on a terminal emulator which can turn any text file into a typing game.
Stars: ✭ 53 (+82.76%)
Mutual labels:  cli-app
Utlyz-CLI
Let's you to access your FB account from the command line and returns various things number of unread notifications, messages or friend requests you have.
Stars: ✭ 30 (+3.45%)
Mutual labels:  cli-app

EasyEuler

EasyEuler is a configurable command line tool for working with Project Euler. It provides support for many languages out of the box and adding more is easy.

This project was inspired by EulerPy and intends to provide the same functionality for a larger variety of languages.

Installation

EasyEuler can be installed from PyPI using pip:

$ pip install easyeuler

Usage

Use create to create a new problem file:

$ easyeuler create 1 python
Written to euler_001.py

$ cat euler_001.py
"""
Problem 1: Multiples of 3 and 5

If we list all the natural numbers below 10 that are multiples of 3 or 5,
we get 3, 5, 6 and 9. The sum of these multiples is 23.

Find the sum of all the multiples of 3 or 5 below 1000.

"""

Once you've come up with a solution, output the result and check if it's correct with verify:

$ easyeuler verify euler_001.py
Checking output of euler_001.py: [no output]  # output in red

$ echo print(12345) > euler_001.py
$ easyeuler verify euler_001.py
Checking output of euler_001.py: 12345        # incorrect solution, output in red

$ echo print(42) > euler_001.py
$ easyeuler verify euler_001.py
Checking output of euler_001.py: 42           # correct solution, output in green

You can even time the execution of your solutions with the time flag:

$ easyeuler verify --time euler_001.py
Checking output of euler_001.py: 42
CPU times - user: 16.7ms, system: 3.33ms, total: 20ms
Wall time: 1.02s

...and execute multiple at once:

$ easyeuler verify *
Checking output of euler_001.py: 42
Checking output of euler_002.c: 12345
Checking output of euler_003.py: [error]  # [error] is displayed if an error occurs during execution

Some problems come with additional files, use generate-resources to generate those:

$ easyeuler create 22 python
Written to euler_022.py
$ cat euler_022.py
"""
Problem 22: Names scores

[....]

This problem references the following resources:

names.txt

"""

$ easyeuler generate-resources 22  # specify the problem ID to generate problem-specific resources
Created names.txt at path .

$ easyeuler generate-resources     # or leave it empty to generate all resources
[....]
Created 326_formula2.gif at path .
Created 326_formula1.gif at path .
Created 327_rooms_of_doom.gif at path .
Created 330_formula.gif at path .

Use list and show to browse problems:

$ easyeuler list
╒══════╤════════════════════════════════════╤══════════════╕
│   ID │ Name                               │ Difficulty   │
╞══════╪════════════════════════════════════╪══════════════╡
│    1 │ Multiples of 3 and 5               │ 5%           │
├──────┼────────────────────────────────────┼──────────────┤
│    2 │ Even Fibonacci numbers             │ 5%           │
├──────┼────────────────────────────────────┼──────────────┤
│    3 │ Largest prime factor               │ 5%           │
├──────┼────────────────────────────────────┼──────────────┤
[....]

$ easyeuler show 2
Problem 2: Even Fibonacci numbers

Each new term in the Fibonacci sequence is generated by adding the
previous two terms. By starting with 1 and 2, the first 10 terms will be:

                  1, 2, 3, 5, 8, 13, 21, 34, 55, 89, ...

Find the sum of all the even-valued terms in the sequence which do not
exceed four million.

Configuration

EasyEuler is designed to be configurable and adaptable to any language you may want to use it with. It follows the XDG Base Directory Specification for locating configuration files. The default location is $HOME/.config/EasyEuler. To see examples of configuration, look at config.json and the templates directory inside the package.

Languages

Adding a new language is as easy as adding a few lines to the config.json file.

A language has the following general attributes:

  • name - name of the language. (required)
  • extension - file extension for the language. (required)
  • template - name of the template file. (default: name)

These commands are executed in order when using the verify command:

  • build - build the file if required.
  • execute - time this command and compare the output to the solution. (default: ./{path})
  • cleanup - remove binary files after execution, etc.

Templates

Templates use the Jinja2 templating engine. New templates should go in the templates directory inside the configuration directory.

Requirements

EasyEuler requires Python 3.5+, along with the Click, Jinja2 and tabulate modules. It has been tested on Windows and Linux and it should work on any other Unix-based platforms, including macOS.

Contributing

Please see CONTRIBUTING.rst for information on how to contribute to this project.

Acknowledgements

The problem descriptions are courtesy of the EulerPy project, which formatted the descriptions from Kyle Keen's Local Euler project into a human-readable form.

License

EasyEuler is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].