Initial Commit

This commit is contained in:
Rekai Nyangadzayi Musuka 2021-12-01 00:32:33 -04:00
parent c35ba20cc3
commit 2fd66c43ba
5 changed files with 32 additions and 1 deletions

3
rust/2021/.gitignore vendored Normal file
View File

@ -0,0 +1,3 @@
/.vscode
/target
/input

7
rust/2021/Cargo.lock generated Normal file
View File

@ -0,0 +1,7 @@
# This file is automatically @generated by Cargo.
# It is not intended for manual editing.
version = 3
[[package]]
name = "advent-of-code-2021"
version = "0.1.0"

15
rust/2021/src/day_01.rs Normal file
View File

@ -0,0 +1,15 @@
pub fn solve_part1(input: &str) -> &str {
input
}
pub fn solve_part2(input: &str) -> &str {
input
}
pub fn run(input: String) {
println!("--- Part 1 ---");
println!("Answer: {}", solve_part1(&input));
print!("\n");
println!("--- Part 2 ---");
println!("Answer: {}", solve_part1(&input))
}

5
rust/2021/src/lib.rs Normal file
View File

@ -0,0 +1,5 @@
mod day_01;
pub fn run(input: String) {
day_01::run(input);
}

View File

@ -1,3 +1,4 @@
fn main() {
println!("Hello, world!");
let input = std::fs::read_to_string("./input/2020/day20.txt").expect("open input file");
advent_of_code_2021::run(input);
}