summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--2023/Go/.gitignore2
-rw-r--r--2023/Go/README.md23
-rw-r--r--2023/Go/Taskfile.yml22
-rw-r--r--2024/OCaml/README.md9
-rw-r--r--2024/PHP/README.md11
-rw-r--r--2024/PHP/day_04/part_01.php2
6 files changed, 52 insertions, 17 deletions
diff --git a/2023/Go/.gitignore b/2023/Go/.gitignore
index 494e767..9f4cb5b 100644
--- a/2023/Go/.gitignore
+++ b/2023/Go/.gitignore
@@ -14,6 +14,8 @@
# Dependency directories (remove the comment below to include it)
# vendor/
+out/
+
# Go workspace file
go.work
go.work.sum
diff --git a/2023/Go/README.md b/2023/Go/README.md
index 13e51cf..9cda93b 100644
--- a/2023/Go/README.md
+++ b/2023/Go/README.md
@@ -1,4 +1,21 @@
-# Advent of Code 2023
-[![Test](https://github.com/DJOLEARY/AoC_2023/actions/workflows/go.yml/badge.svg?event=push)](https://github.com/DJOLEARY/AoC_2023/actions/workflows/go.yml)
+# Go 2023
-Done with the aim of learning golang
+## Getting Started
+
+### How to Build
+
+```sh
+task build
+```
+
+### How to Run
+
+```sh
+task run
+```
+
+### How to Test
+
+```sh
+task test
+```
diff --git a/2023/Go/Taskfile.yml b/2023/Go/Taskfile.yml
index a89c4c3..a07c24c 100644
--- a/2023/Go/Taskfile.yml
+++ b/2023/Go/Taskfile.yml
@@ -1,17 +1,23 @@
# https://taskfile.dev
-version: '3'
-
+version: "3"
tasks:
-
default:
- desc: "Prints this message"
+ desc: Prints this message
cmds:
- cmd: task --list-all
-
+ build:
+ cmds:
+ - cmd: go build -o=out/Advent_of_Code_2023 main.go
+ run:
+ cmds:
+ - cmd: go run main.go {{.CLI_ARGS}}
+ test:
+ cmds:
+ - cmd: go test ./...
test:coverage:
desc: Runs tests and produce coverage report
cmds:
- - mkdir --parents out
- - go test -coverprofile=out/coverage.out ./...
- - go tool cover -html=out/coverage.out
+ - cmd: mkdir --parents out
+ - cmd: go test -coverprofile=out/coverage.out ./...
+ - cmd: go tool cover -html=out/coverage.out
diff --git a/2024/OCaml/README.md b/2024/OCaml/README.md
index 96db988..caa88fe 100644
--- a/2024/OCaml/README.md
+++ b/2024/OCaml/README.md
@@ -1,22 +1,21 @@
-# Advent of Code 2024
+# OCaml 2024
## Getting Started
### How to Build
```sh
-dune build
+task build
```
### How to Run
```sh
-dune exec AoC_2024
+task run
```
### How to Test
```sh
-dune runtest
+task test
```
-
diff --git a/2024/PHP/README.md b/2024/PHP/README.md
new file mode 100644
index 0000000..6aeb9d6
--- /dev/null
+++ b/2024/PHP/README.md
@@ -0,0 +1,11 @@
+# PHP 2024
+
+## Getting Started
+
+### How to Run
+
+Run the php script directly, e.g.
+
+```sh
+php day_XX/part_YY.php
+```
diff --git a/2024/PHP/day_04/part_01.php b/2024/PHP/day_04/part_01.php
index 250da0c..ae67a4f 100644
--- a/2024/PHP/day_04/part_01.php
+++ b/2024/PHP/day_04/part_01.php
@@ -5,7 +5,7 @@ declare(strict_types=1);
spl_autoload_register(fn(string $className) => require "{$className}.php");
// Assumes executed from workspace root
-$input = new Input('input/day_04.txt');
+$input = new Input('../_input/day_04.txt');
if ($input->contents === "") {
throw new RuntimeException("File not found");
}