18 lines
380 B
Bash
Executable File
18 lines
380 B
Bash
Executable File
#!/bin/sh
|
|
|
|
today=$(date +%d)
|
|
mkdir "$today"
|
|
cd "$today"
|
|
cargo init --name "day$today"
|
|
echo 'Initialized cargo project'
|
|
cargo add itertools
|
|
|
|
# this assumes that your puzzle input is already in your clipboard
|
|
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()
|
|
}' >> src/main.rs
|