Skip to content

Commit 381ed7d

Browse files
committed
add 2018 template
1 parent d167289 commit 381ed7d

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

2018/template/Cargo.toml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
[package]
2+
name = "day-xx"
3+
version = "0.0.0"
4+
edition = "2021"
5+
6+
[dependencies]
7+
anyhow = "1.0.66"
8+
chrono = "0.4.23"
9+
itertools = "0.10.5"
10+
lazy_static = "1.4.0"
11+
regex = "1.7.0"
12+
13+
[dev-dependencies]
14+
pretty_assertions = "1.3.0"

2018/template/src/main.rs

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#![allow(dead_code, unused_imports, unused_variables)]
2+
3+
use itertools::Itertools;
4+
use std::fs;
5+
6+
fn main() {
7+
let input = read_and_trim_input();
8+
9+
let part_1a = "?";
10+
println!("{}: {}", stringify!(part_1a), part_1a);
11+
12+
let part_2a = "?";
13+
println!("{}: {}", stringify!(part_2a), part_2a);
14+
}
15+
16+
fn read_and_trim_input() -> String {
17+
let file = fs::read_to_string("input").unwrap();
18+
file.trim().to_owned()
19+
}
20+
21+
#[cfg(test)]
22+
mod tests {
23+
use super::*;
24+
use pretty_assertions::assert_eq;
25+
26+
#[test]
27+
fn part_1_examples() {
28+
assert_eq!(1, 1);
29+
}
30+
31+
#[test]
32+
fn part_1_input() {
33+
let input = read_and_trim_input();
34+
35+
assert_eq!(1, 1);
36+
}
37+
38+
#[test]
39+
fn part_2_examples() {
40+
assert_eq!(1, 1);
41+
}
42+
43+
#[test]
44+
fn part_2_input() {
45+
let input = read_and_trim_input();
46+
47+
assert_eq!(1, 1);
48+
}
49+
}

0 commit comments

Comments
 (0)