1
0
mirror of https://gitlab.com/MisterBiggs/aoc-2023-rust.git synced 2025-06-15 14:36:50 +00:00

Initialize repo

This commit is contained in:
Anson 2022-12-01 15:19:09 -07:00
commit 971581dd85
6 changed files with 2304 additions and 0 deletions

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
/target
/tests

7
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 = "aoc_2022"
version = "0.1.0"

8
Cargo.toml Normal file
View 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

File diff suppressed because it is too large Load Diff

51
src/day1.rs Normal file
View 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
View File

@ -0,0 +1,5 @@
mod day1;
fn main() {
println!("Running Advent of Code 2022");
day1::run();
}