2020/09 skeleton

This commit is contained in:
kageru 2020-12-09 08:57:54 +01:00
parent 4d2cc20f0e
commit cd43e6f3dd
Signed by: kageru
GPG Key ID: 8282A2BEA4ADA3D2
3 changed files with 1030 additions and 5 deletions

1000
2020/inputs/day09 Normal file

File diff suppressed because it is too large Load Diff

View File

@ -2,12 +2,11 @@
today=$(date +%d)
# this assumes that your puzzle input is already in your clipboard
xsel -b > inputs/$today
xsel -b > inputs/day$today
# add trailing newline if necessary
sed -i -e '$a\' inputs/$today
sed -i -e '$a\' inputs/day$today
echo '
#![feature(test)]
echo '#![feature(test)]
extern crate test;
use std::env;
@ -32,4 +31,4 @@ mod tests {
const TEST_INPUT: &str = "";
}' > src/day$today.rs
}' > src/bin/day$today.rs

26
2020/src/bin/day09.rs Normal file
View File

@ -0,0 +1,26 @@
#![feature(test)]
extern crate test;
use std::env;
fn read_input() -> String {
std::fs::read_to_string(env::args().nth(1).filter(|n| n != "--bench").unwrap_or(String::from("inputs/day09"))).unwrap()
}
fn parse_input(raw: &str) -> Vec<!> {
unimplemented!()
}
fn main() {
let input = parse_input(&read_input());
println!("Part 1: {}", part1(&input));
println!("Part 2: {}", part2(&input));
}
#[cfg(test)]
mod tests {
use super::*;
use test::black_box;
const TEST_INPUT: &str = "";
}