Extend setup day template
This commit is contained in:
parent
5ad7c52fec
commit
60d2a911b9
@ -12,8 +12,23 @@ xsel -b > input
|
||||
# add trailing newline if necessary
|
||||
sed -i -e '$a\' input
|
||||
|
||||
echo 'fn read_input() -> String {
|
||||
std::fs::read_to_string("input").unwrap()
|
||||
echo '
|
||||
#![feature(test)]
|
||||
extern crate test;
|
||||
use std::env;
|
||||
|
||||
fn read_input() -> String {
|
||||
std::fs::read_to_string(env::args().nth(1).unwrap_or(String::from("input"))).unwrap()
|
||||
}
|
||||
|
||||
fn parse_input(raw: &str) -> ! {
|
||||
unimplemented!()
|
||||
}
|
||||
|
||||
fn main() {
|
||||
let input = parse_input(&read_input());
|
||||
println!("Part 1: {}", part1(&input));
|
||||
println!("Part 2: {}", part2(&input));
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
@ -21,4 +36,6 @@ mod tests {
|
||||
use super::*;
|
||||
use test::black_box;
|
||||
|
||||
const TEST_INPUT: &str = "";
|
||||
|
||||
}' >> src/main.rs
|
||||
|
Loading…
Reference in New Issue
Block a user