more prep
This commit is contained in:
parent
a3e86e69c8
commit
b59c855a30
31
01/main.rs
Normal file
31
01/main.rs
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io;
|
||||||
|
use std::io::BufRead;
|
||||||
|
use std::path::Path;
|
||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let now = Instant::now();
|
||||||
|
part_one();
|
||||||
|
let part_one_duration = now.elapsed();
|
||||||
|
part_two();
|
||||||
|
let part_two_duration = now.elapsed();
|
||||||
|
println!(
|
||||||
|
"p1: {}ms, p2: {}ms",
|
||||||
|
part_one_duration.as_millis(),
|
||||||
|
part_two_duration.as_millis()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||||
|
where
|
||||||
|
P: AsRef<Path>,
|
||||||
|
{
|
||||||
|
let file = File::open(filename)?;
|
||||||
|
Ok(io::BufReader::new(file).lines())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn part_one() {}
|
||||||
|
|
||||||
|
fn part_two() {}
|
7
Cargo.lock
generated
Normal file
7
Cargo.lock
generated
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
# This file is automatically @generated by Cargo.
|
||||||
|
# It is not intended for manual editing.
|
||||||
|
version = 3
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "adventofcode2022"
|
||||||
|
version = "0.1.0"
|
8
Cargo.toml
Normal file
8
Cargo.toml
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
[package]
|
||||||
|
name = "AdventOfCode2022"
|
||||||
|
version = "0.1.0"
|
||||||
|
edition = "2021"
|
||||||
|
|
||||||
|
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
|
||||||
|
|
||||||
|
[dependencies]
|
31
main.rs.tmpl
Normal file
31
main.rs.tmpl
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
#![allow(dead_code)]
|
||||||
|
use std::fs::File;
|
||||||
|
use std::io;
|
||||||
|
use std::io::BufRead;
|
||||||
|
use std::path::Path;
|
||||||
|
use std::time::Instant;
|
||||||
|
|
||||||
|
fn main() {
|
||||||
|
let now = Instant::now();
|
||||||
|
part_one();
|
||||||
|
let part_one_duration = now.elapsed();
|
||||||
|
part_two();
|
||||||
|
let part_two_duration = now.elapsed();
|
||||||
|
println!(
|
||||||
|
"p1: {}ms, p2: {}ms",
|
||||||
|
part_one_duration.as_millis(),
|
||||||
|
part_two_duration.as_millis()
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
fn read_lines<P>(filename: P) -> io::Result<io::Lines<io::BufReader<File>>>
|
||||||
|
where
|
||||||
|
P: AsRef<Path>,
|
||||||
|
{
|
||||||
|
let file = File::open(filename)?;
|
||||||
|
Ok(io::BufReader::new(file).lines())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn part_one() {}
|
||||||
|
|
||||||
|
fn part_two() {}
|
4
new.sh
Normal file → Executable file
4
new.sh
Normal file → Executable file
@ -9,7 +9,7 @@ if [ "${1}" != "" ]; then
|
|||||||
if [ ! -f "${padded}/inputs/input" ]; then
|
if [ ! -f "${padded}/inputs/input" ]; then
|
||||||
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
curl -s -H "Cookie: session=`cat .cookie`" https://adventofcode.com/${__year}/day/${1##0}/input > "${padded}/inputs/input"
|
||||||
fi
|
fi
|
||||||
if [ ! -f "${padded}/main.go" ]; then
|
if [ ! -f "${padded}/main.rs" ]; then
|
||||||
cp -n main.go.tmpl ${padded}/main.go
|
cp -n main.rs.tmpl ${padded}/main.rs
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
Loading…
Reference in New Issue
Block a user