master
evan hemsley 2018-09-20 03:38:09 -07:00
parent 1dc3b030e0
commit 4c6bfa1821
6 changed files with 26 additions and 0 deletions

1
.gitignore vendored
View File

@ -3,3 +3,4 @@
c/binaries
*/bin/*
*.dwarf
rust/target

4
rust/Cargo.lock generated Normal file
View File

@ -0,0 +1,4 @@
[[package]]
name = "euler-rust"
version = "0.1.0"

6
rust/Cargo.toml Normal file
View File

@ -0,0 +1,6 @@
[package]
name = "euler-rust"
version = "0.1.0"
authors = ["evan hemsley <evan.hemsley@gmail.com>"]
[dependencies]

1
rust/src/euler/mod.rs Normal file
View File

@ -0,0 +1 @@
pub mod problem_001;

View File

@ -0,0 +1,13 @@
fn solution() -> i32 {
return (1..1000).filter( |n| (n % 3 == 0) || (n % 5 == 0)).sum();
}
#[cfg(test)]
mod tests {
use euler::problem_001::solution;
#[test]
fn problem_001() {
assert_eq!(solution(), 233168);
}
}

1
rust/src/lib.rs Normal file
View File

@ -0,0 +1 @@
pub mod euler;