2023-03-12 15:20:02 +01:00
|
|
|
#!/usr/local/bin/zsh
|
|
|
|
|
|
|
|
if [ $# -ne 2 ]; then
|
|
|
|
echo "Usage: $0 day name"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2025-08-18 19:22:30 +02:00
|
|
|
/usr/local/bin/cargo new --lib day${1}_${2}
|
2023-12-10 10:55:06 +01:00
|
|
|
cp -r ../day00/benches day${1}_${2}/
|
2023-03-12 15:20:02 +01:00
|
|
|
cp -r ../day00/tests day${1}_${2}/
|
|
|
|
cp ../day00/src/lib.rs day${1}_${2}/src/
|
|
|
|
cd day${1}_${2}
|
2023-12-10 10:55:06 +01:00
|
|
|
echo '
|
|
|
|
[dev-dependencies]
|
2025-08-18 19:22:30 +02:00
|
|
|
# criterion = "0.5.1"
|
2023-12-10 10:55:06 +01:00
|
|
|
|
|
|
|
[[bench]]
|
|
|
|
name = "test_benchmark"
|
|
|
|
harness = false' >> Cargo.toml
|
|
|
|
echo -e "use day${1}_${2}::run;\n$(cat benches/test_benchmark.rs)" > benches/test_benchmark.rs
|
2023-04-03 17:53:42 +02:00
|
|
|
# echo 'intcode_processor = { path = "../common/intcode_processor" }' >> Cargo.toml
|
2023-03-12 15:20:02 +01:00
|
|
|
aocf checkout $1
|
2025-08-18 19:22:30 +02:00
|
|
|
aocf brief > challenge.md
|
2023-03-12 15:20:02 +01:00
|
|
|
aocf input > tests/challenge_input
|
|
|
|
/usr/local/bin/nvim src/lib.rs
|