Expand description
§peuler
peuler is a Rust crate with solutions to the Project Euler problems.
It contains solutions to the problems that I have solved so far, and I plan to add more solutions as I solve more problems.
Many general-purpose mathematical functions are offloaded to the pmath crate.
§Example
use peuler::{PEuler, ProjectEuler};
let peuler = PEuler::new();
assert_eq!(peuler.solve(1).unwrap(), "233168");
§No-std support
There is currently no support for no-std
environments.
§WebAssembly support
Since this crate depends on pmath,
which in turn depends on getrandom,
wasm32-unknown-unknown
target is supported, but requires --cfg getrandom_backend="wasm_js"
flag to be passed to the compiler.
See getrandom crate’s documentation for more details.
Other WASM targets should work out of the box.
§Command Line Interface
This crate also provides a command line interface (CLI) binary named peuler
.
You can install it via cargo
:
cargo install --features=cli peuler
Then, to solve the first Project Euler problem, run:
peuler 1
For more information, run:
peuler --help
§Features
This crate has the following optional (disabled by default) features:
cli
: Enables the optional dependencies for building the CLI binary.
§License
This project is licensed under the MIT License.
§Contributing
Contributions to the currently available problems are welcome!
Please open an issue or a pull request in the GitHub repository.
Don’t submit solutions to the currently unsolved problems, as I plan to solve them on my own.
Modules§
- problems
- Project Euler problems with solutions.
Structs§
- PEuler
- A structure representing the Project Euler.
Enums§
- Error
- An enum representing errors that can occur in this crate.
Traits§
- Problem
- A trait representing the Project Euler problem.
- Project
Euler - A trait representing the Project Euler.
- Solution
- A trait representing the Project Euler problem’s solution.