2020/09 skeleton
This commit is contained in:
parent
4d2cc20f0e
commit
cd43e6f3dd
1000
2020/inputs/day09
Normal file
1000
2020/inputs/day09
Normal file
File diff suppressed because it is too large
Load Diff
@ -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
26
2020/src/bin/day09.rs
Normal 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 = "";
|
||||
|
||||
}
|
Loading…
Reference in New Issue
Block a user