From fc9a332e6382da02d7c72290e4b8de36f2ec0063 Mon Sep 17 00:00:00 2001 From: Davide Oddone Date: Sat, 2 Dec 2023 16:49:56 +0000 Subject: [PATCH 1/4] Changed folder structure --- day01/trebuchet.go | 2 +- day02/lottacubes.go | 2 +- day01/input => inputs/day01_input | 0 day02/input => inputs/day02_input | 0 4 files changed, 2 insertions(+), 2 deletions(-) rename day01/input => inputs/day01_input (100%) rename day02/input => inputs/day02_input (100%) diff --git a/day01/trebuchet.go b/day01/trebuchet.go index f3b5df3..8d02de1 100644 --- a/day01/trebuchet.go +++ b/day01/trebuchet.go @@ -109,7 +109,7 @@ func CombineIndexes(s string) int { } func main() { - file, err := os.Open("input") + file, err := os.Open("../inputs/day01_input") check(err) defer file.Close() diff --git a/day02/lottacubes.go b/day02/lottacubes.go index ccbd344..f3455c4 100644 --- a/day02/lottacubes.go +++ b/day02/lottacubes.go @@ -140,7 +140,7 @@ func PrintAndWait[T any](x T) { } func main() { - file, err := os.Open("input") + file, err := os.Open("../inputs/day02_input") check(err) defer file.Close() diff --git a/day01/input b/inputs/day01_input similarity index 100% rename from day01/input rename to inputs/day01_input diff --git a/day02/input b/inputs/day02_input similarity index 100% rename from day02/input rename to inputs/day02_input From 492d2a602a971a1486846aa1a91cb266774ceaea Mon Sep 17 00:00:00 2001 From: Davide Oddone Date: Sat, 2 Dec 2023 16:50:46 +0000 Subject: [PATCH 2/4] Trying to run the code for day01 --- .github/workflows/build.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index e95e224..32423c8 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,6 +14,8 @@ jobs: run: go build -v ./day01/*.go - name: Build day two run: go build -v ./day02/*.go + - name: Run day one + run: go run -v ./day01/*.go - name: Display Go version run: go version - name: List files in the repository From 79f63b0bf00fd874c6b021bb97d9bb49348ac061 Mon Sep 17 00:00:00 2001 From: Davide Oddone Date: Sat, 2 Dec 2023 16:56:35 +0000 Subject: [PATCH 3/4] Truying to do something really silly with symlinks --- day01/day01_input | 1 + day01/trebuchet.go | 2 +- day02/day02_input | 1 + day02/lottacubes.go | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) create mode 120000 day01/day01_input create mode 120000 day02/day02_input diff --git a/day01/day01_input b/day01/day01_input new file mode 120000 index 0000000..c127fa7 --- /dev/null +++ b/day01/day01_input @@ -0,0 +1 @@ +../inputs/day01_input \ No newline at end of file diff --git a/day01/trebuchet.go b/day01/trebuchet.go index 8d02de1..1a7f727 100644 --- a/day01/trebuchet.go +++ b/day01/trebuchet.go @@ -109,7 +109,7 @@ func CombineIndexes(s string) int { } func main() { - file, err := os.Open("../inputs/day01_input") + file, err := os.Open("./day01_input") check(err) defer file.Close() diff --git a/day02/day02_input b/day02/day02_input new file mode 120000 index 0000000..be59d2c --- /dev/null +++ b/day02/day02_input @@ -0,0 +1 @@ +../inputs/day02_input \ No newline at end of file diff --git a/day02/lottacubes.go b/day02/lottacubes.go index f3455c4..42b53e6 100644 --- a/day02/lottacubes.go +++ b/day02/lottacubes.go @@ -140,7 +140,7 @@ func PrintAndWait[T any](x T) { } func main() { - file, err := os.Open("../inputs/day02_input") + file, err := os.Open("./day02_input") check(err) defer file.Close() From df779eb5102a906381a9e423e04aa34916191403 Mon Sep 17 00:00:00 2001 From: Davide Oddone Date: Sat, 2 Dec 2023 16:59:44 +0000 Subject: [PATCH 4/4] Fixed a small oversight in folder structure --- day01/day01_input | 1 - day01/inputs | 1 + day01/trebuchet.go | 2 +- day02/day02_input | 1 - day02/inputs | 1 + day02/lottacubes.go | 2 +- 6 files changed, 4 insertions(+), 4 deletions(-) delete mode 120000 day01/day01_input create mode 120000 day01/inputs delete mode 120000 day02/day02_input create mode 120000 day02/inputs diff --git a/day01/day01_input b/day01/day01_input deleted file mode 120000 index c127fa7..0000000 --- a/day01/day01_input +++ /dev/null @@ -1 +0,0 @@ -../inputs/day01_input \ No newline at end of file diff --git a/day01/inputs b/day01/inputs new file mode 120000 index 0000000..a80bb2b --- /dev/null +++ b/day01/inputs @@ -0,0 +1 @@ +../inputs \ No newline at end of file diff --git a/day01/trebuchet.go b/day01/trebuchet.go index 1a7f727..d62f968 100644 --- a/day01/trebuchet.go +++ b/day01/trebuchet.go @@ -109,7 +109,7 @@ func CombineIndexes(s string) int { } func main() { - file, err := os.Open("./day01_input") + file, err := os.Open("./inputs/day01_input") check(err) defer file.Close() diff --git a/day02/day02_input b/day02/day02_input deleted file mode 120000 index be59d2c..0000000 --- a/day02/day02_input +++ /dev/null @@ -1 +0,0 @@ -../inputs/day02_input \ No newline at end of file diff --git a/day02/inputs b/day02/inputs new file mode 120000 index 0000000..a80bb2b --- /dev/null +++ b/day02/inputs @@ -0,0 +1 @@ +../inputs \ No newline at end of file diff --git a/day02/lottacubes.go b/day02/lottacubes.go index 42b53e6..b46856c 100644 --- a/day02/lottacubes.go +++ b/day02/lottacubes.go @@ -140,7 +140,7 @@ func PrintAndWait[T any](x T) { } func main() { - file, err := os.Open("./day02_input") + file, err := os.Open("./inputs/day02_input") check(err) defer file.Close()