mirror of
https://gitlab.com/MisterBiggs/aoc_2022-rust.git
synced 2025-06-15 14:46:44 +00:00
Initialize repo
This commit is contained in:
commit
971581dd85
2
.gitignore
vendored
Normal file
2
.gitignore
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
/target
|
||||
/tests
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
||||
# This file is automatically @generated by Cargo.
|
||||
# It is not intended for manual editing.
|
||||
version = 3
|
||||
|
||||
[[package]]
|
||||
name = "aoc_2022"
|
||||
version = "0.1.0"
|
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
||||
[package]
|
||||
name = "aoc_2022"
|
||||
version = "0.1.0"
|
||||
edition = "2021"
|
||||
|
||||
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||
|
||||
[dependencies]
|
2231
inputs/day1.txt
Normal file
2231
inputs/day1.txt
Normal file
File diff suppressed because it is too large
Load Diff
51
src/day1.rs
Normal file
51
src/day1.rs
Normal file
@ -0,0 +1,51 @@
|
||||
use std::fs;
|
||||
|
||||
pub fn run() {
|
||||
println!("Day 1:");
|
||||
let input = fs::read_to_string("./inputs/day1.txt").expect("Could not read file");
|
||||
|
||||
println!("\tPart 1: {}", part1(&input));
|
||||
println!("\tPart 2: {}", part2(&input));
|
||||
}
|
||||
|
||||
fn part1(food_list: &str) -> isize {
|
||||
todo!()
|
||||
}
|
||||
fn part2(food_list: &str) -> usize {
|
||||
todo!()
|
||||
}
|
||||
|
||||
// #[cfg(test)]
|
||||
// mod tests {
|
||||
// use super::*;
|
||||
|
||||
// #[test]
|
||||
// fn test_1() {
|
||||
// let mut input = "(())".to_string();
|
||||
// assert_eq!(part1(&input), 0);
|
||||
|
||||
// input = "()()".to_string();
|
||||
// assert_eq!(part1(&input), 0);
|
||||
|
||||
// input = "(((".to_string();
|
||||
// assert_eq!(part1(&input), 3);
|
||||
|
||||
// input = "(()(()(".to_string();
|
||||
// assert_eq!(part1(&input), 3);
|
||||
|
||||
// input = "())".to_string();
|
||||
// assert_eq!(part1(&input), -1);
|
||||
|
||||
// input = ")())())".to_string();
|
||||
// assert_eq!(part1(&input), -3);
|
||||
// }
|
||||
|
||||
// #[test]
|
||||
// fn test_2() {
|
||||
// let mut input = ")".to_string();
|
||||
// assert_eq!(part2(&input), 1);
|
||||
|
||||
// input = "()())".to_string();
|
||||
// assert_eq!(part2(&input), 5);
|
||||
// }
|
||||
// }
|
5
src/main.rs
Normal file
5
src/main.rs
Normal file
@ -0,0 +1,5 @@
|
||||
mod day1;
|
||||
fn main() {
|
||||
println!("Running Advent of Code 2022");
|
||||
day1::run();
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user