diff --git a/Cargo.lock b/Cargo.lock index cf569c8..66bebfc 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,4 +12,3 @@ dependencies = [ [[package]] name = "utils" version = "0.1.0" -source = "git+https://git.plobos.xyz/projects/PuzzleUtils.git#d3a93a875f56c8f865411c0b7437986f413ca524" diff --git a/Cargo.toml b/Cargo.toml index caf82fe..08bb17d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,4 +6,5 @@ edition = "2021" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -utils = { git = "https://git.plobos.xyz/projects/PuzzleUtils.git" } +#utils = { git = "https://git.plobos.xyz/projects/PuzzleUtils.git" } +utils = { path = "/home/fabian/Git/utils/" } diff --git a/src/bin/problem_26.rs b/src/bin/problem_26.rs new file mode 100644 index 0000000..293e39a --- /dev/null +++ b/src/bin/problem_26.rs @@ -0,0 +1,19 @@ +use utils::fraction::Fraction; + +fn main() { + println!("Start"); + let mut longest = (0, 0); + for denominator in 7..13 { + println!("1/{denominator}:"); + let f = Fraction { + numerator: 1.into(), + denominator: denominator.into(), + }; + let rep = f.get_repeating(); + if longest.1 < rep.digits.len() { + longest = (denominator, rep.digits.len()); + } + println!("{rep}"); + } + println!("longest {}", longest.0); +}