https://github.com/pythonhacker/project-euler-rust
Project Euler Solutions in Rust
https://github.com/pythonhacker/project-euler-rust
Last synced: about 1 year ago
JSON representation
Project Euler Solutions in Rust
- Host: GitHub
- URL: https://github.com/pythonhacker/project-euler-rust
- Owner: pythonhacker
- License: apache-2.0
- Created: 2020-05-29T16:30:39.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-07-12T13:40:23.000Z (almost 6 years ago)
- Last Synced: 2024-10-11T14:42:07.928Z (over 1 year ago)
- Language: Rust
- Size: 101 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## About
The repo contains original solutions to [Project Euler][1] in Rust.
## Source files
Each source file maps to a given Project Euler problem by index. So `Problem `1 -> `problem1.rs`, `Problem 2` -> `problem2.rs` etc.
The compilation is done using Rust's cargo tool.
## Pre-requisites
Ensure that you have the latest stable `Rust` compiler and associated build tools (`Cargo`) installed. Verify that you are able to install external crates. The code here has been built and tested with Rust version 1.34.2 .
## Building code
### Using Makefile
Just run `make` on the repo.
$ make
Do `make clean` to clean the binary targets.
$ make clean
### Manual
Run the script `build_cargo.py` using python to create a `Cargo.toml` from the rust source files. Now build the code using,
$ cargo build
## Run solution
A given solution can be run by using its binary. Example to run solution to `Problem 1`
$ cargo run --bin problem1
## Principles
1. All the code here is originally written by the author. No code has been copied from any other source.
2. An effort has been maintained to write code with least compiler warnings and generally keeping up with Rust coding principles. However the code is not pedantic Rust.
3. Almost all code is written with performance in mind and keep up with Project Euler principle of running under a minute. (Most solutions run under a second.)
[1]: http://projecteuler.net
## Copyright
Copyright © 2020 - Anand B Pillai <anandpillai at letterboxes dot org>