-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathprepare.sh
More file actions
executable file
·51 lines (41 loc) · 1.22 KB
/
prepare.sh
File metadata and controls
executable file
·51 lines (41 loc) · 1.22 KB
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
#!/bin/zsh
# Check if an argument was provided
if [ -z "$1" ]; then
echo "Usage: ./create_day_folder.sh <day_number>"
exit 1
fi
# Format the input as a two-digit number (e.g., 1 -> 01, 10 -> 10)
day_number=$(printf "%02d" $1)
day_folder="Day${day_number}"
# Paths
input_path="./input/2024/${day_folder}"
solution_path="./2024/${day_folder}"
# Create directories and files for input
mkdir -p "$input_path"
touch "$input_path/input" "$input_path/test"
# Create directory for solution and the C# file
mkdir -p "$solution_path"
solution_file="${solution_path}/Solution.cs"
# Write the base C# code to the file
cat > "$solution_file" << EOF
using System;
using System.IO;
namespace adventofcode.Year2024.Day${day_number}
{
public class Solution : BaseSolution, ISolver
{
public void SolvePart1()
{
var inputFilePath = GetInputFilePath("test");
// var inputFilePath = GetInputFilePath();
string[] lines = File.ReadAllLines(inputFilePath);
// Add your Part 1 solution logic here
}
public void SolvePart2()
{
Console.WriteLine("not implemented");
}
}
}
EOF
echo "Created folder structure and files for Day ${day_number}."