diff --git a/day1/example.txt b/day01/example.txt similarity index 100% rename from day1/example.txt rename to day01/example.txt diff --git a/day1/example2.txt b/day01/example2.txt similarity index 100% rename from day1/example2.txt rename to day01/example2.txt diff --git a/day1/part1.go b/day01/part1.go similarity index 100% rename from day1/part1.go rename to day01/part1.go diff --git a/day1/part2.go b/day01/part2.go similarity index 100% rename from day1/part2.go rename to day01/part2.go diff --git a/day2/day2.go b/day02/day2.go similarity index 100% rename from day2/day2.go rename to day02/day2.go diff --git a/day2/example.txt b/day02/example.txt similarity index 100% rename from day2/example.txt rename to day02/example.txt diff --git a/day_template/day.go b/day_template/day.go new file mode 100644 index 0000000..5bbfd25 --- /dev/null +++ b/day_template/day.go @@ -0,0 +1,35 @@ +package main + +import ( + "fmt" + "io" + "os" + "strings" +) + +func readInput() string { + stdin, err := io.ReadAll(os.Stdin) + + if err != nil { + panic(err) + } + str := string(stdin) + return str +} + +func part1(lines []string) { + fmt.Println("Part 1 not implemented") +} + +func part2(lines []string) { + fmt.Println("Part 2 not implemented") +} + +func main() { + input := readInput() + lines := strings.Split(input, "\n") + fmt.Println("---PART 1---") + part1(lines) + fmt.Println("---PART 2---") + part2(lines) +} diff --git a/new_day.sh b/new_day.sh new file mode 100644 index 0000000..5729d32 --- /dev/null +++ b/new_day.sh @@ -0,0 +1,22 @@ +#!/bin/sh +# Code borrowed from https://github.com/Daste745/aoc-2023/blob/master/new_day.sh +if [ -z "$1" ] +then + cat << EOF +Usage: new_day.sh + +Example: new_day.sh 08 +EOF + exit 1 +fi + +day_number=$1 +if [ -d "day$day_number" ] +then + echo "Day$day_number already exists" + exit 1 +fi + +mkdir -p ./day$day_number/ +cp -v ./day_template/day.go ./day$day_number/day$day_number.go +