Skip to content

Red-Rapious/Euler-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

48 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Euler-Rust

My Project Euler track in Rust. Every solution is commented, and some problems feature multiple solutions.

Compiling and Running

Default cargo run

This project uses Cargo. With rust installed on your machine, you can execute my code with:

$ cargo run

The main program then asks for a Problem number to run, which you can enter in the command line:

$ cargo run
    Compiling ...
     Finished ...
      Running ...
Problem number:
1

Environment Argument

Alternatively, you can directly pass the problem number as an environment argument:

$ cargo run 1
    Compiling ...
     Finished ...
      Running ...
Problem 1 solution: ...

Unit Tests

Finally, I have configured unit tests for each problem. You can run them with:

$ cargo test

or to run a specific test:

$ cargo test test_problem1

Some problems have multiple solutions, and the unit tests are configured to run all of them.

$ cargo test test_problem1_v2

Some solutions, such as the one for Problem 23, take a few more seconds to run than the others. Corresponding tests are ignored by default, but you can run them with:

$ cargo test -- --ignored

or to run all tests, ignored or not:

$ cargo test -- --include-ignored

Problems solved

License

This work is licensed under the CC-BY-NC-SA 4.0 license. Original content is the property of the Project Euler website and also licensed under CC-BY-NC-SA 4.0.

About

My Project Euler track in Rust.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages