2020-12-01 07:16:56 +01:00
#!/bin/sh
today = $( date +%d)
# this assumes that your puzzle input is already in your clipboard
2020-12-08 11:32:59 +01:00
xsel -b > inputs/$today
2020-12-01 07:16:56 +01:00
# add trailing newline if necessary
2020-12-08 11:32:59 +01:00
sed -i -e '$a\' inputs/$today
2020-12-03 10:24:03 +01:00
2020-12-07 16:17:07 +01:00
echo '
#![feature(test)]
extern crate test;
use std::env;
fn read_input( ) -> String {
2020-12-08 11:32:59 +01:00
std::fs::read_to_string( env::args( ) .nth( 1) .filter( | n| n != "--bench" ) .unwrap_or( String::from( " inputs/day' $today ' " ) ) ) .unwrap( )
2020-12-07 16:17:07 +01:00
}
2020-12-08 10:58:41 +01:00
fn parse_input( raw: & str) -> Vec<!> {
2020-12-07 16:17:07 +01:00
unimplemented!( )
}
fn main( ) {
let input = parse_input( & read_input( ) ) ;
println!( "Part 1: {}" , part1( & input) ) ;
println!( "Part 2: {}" , part2( & input) ) ;
2020-12-05 09:50:09 +01:00
}
#[cfg(test)]
mod tests {
use super::*;
use test::black_box;
2020-12-07 16:17:07 +01:00
const TEST_INPUT: & str = "" ;
2020-12-08 11:32:59 +01:00
} ' > src/day$today .rs