-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsetup.sh
executable file
·53 lines (40 loc) · 919 Bytes
/
setup.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
#!/bin/bash
DAY=$1
SRC_FILE="src/days/day_${DAY}.rs"
INPUT_FILE="src/input/${DAY}.txt"
echo "use crate::utils::*;
#[allow(unused)]
pub fn run() {
#[allow(unused_variables)]
let input = include_str!(\"../input/${DAY}.txt\");
// let input = \"\";
// let mut grid = _grid(input);
let result = input
//.lines()
//.chars()
//.map(parse)
//.map(|l| sscanf!(l, \"\").unwrap())
//.map(|()|)
//.filter(|()|)
//.to_vec()
//.sum::<isize>()
//.inspect(|x| pv!(x))
//.count()
;
result!(result);
}" > "${SRC_FILE}"
echo "#![allow(unused_imports)]
#[macro_use]
mod utils;
mod days {
pub mod day_${DAY};
}
fn main() {
days::day_${DAY}::run();
}" > src/main.rs
touch "${INPUT_FILE}"
if [ -d /mnt/c ]; then
cmd.exe /c code "${SRC_FILE}" "${INPUT_FILE}"
else
code "${SRC_FILE}" "${INPUT_FILE}"
fi