Skip to content

Commit

Permalink
Updated README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
byte2pixel committed Dec 27, 2024
1 parent ac3b751 commit 99df7df
Showing 1 changed file with 21 additions and 24 deletions.
45 changes: 21 additions & 24 deletions 2024/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,20 @@

Welcome to the AdventOfCode 2024 CLI! This tool helps you manage and run my Advent of Code solutions for the year 2024.

## Installation
## Building Exe

Clone the repository and open a terminal to the AdventOfCode folder

```sh
cd ./2024/Advent
dotnet build
dotnet publish -c Release
```

## Usage

Here are some common commands you can use with the AdventOfCode 2024 CLI:

### Run Solutions (Option 1)
### Run using dotnet CLI

Using the dotnet cli.

Expand All @@ -25,32 +25,27 @@ Example from `./2024/Advent` folder

```sh
dotnet run -- day1
dotnet run -- day2
dotnet run -- day6
dotnet run -- day2 --part 2
dotnet run -- day6 -p 1
dotnet run -- day15 --help
dotnet run -- day25
```

Each day may have multipl parts use the help command to see additional arguments.
Each day has multiple parts use the help command to see additional arguments.
If an argument is not specified but required you will be prompted to make a selection.

```sh
dotnet run -- day1 --help
```

Example:

```sh
dotnet run -- day1 --part 1
dotnet run -- day1 --part "Part 1"
```

### Run Solutions (Option 2)
### Run using exe

Example from `./2024/Advent` folder
The key is the input folder with all the input files needs to be located in the current directory.
If you run the publish command you will get a single file exe that is fully
self-contained. Publish for your target os and run it as if you would any other CLI

```sh
dotnet build -c Release
dotnet publish -c Release --runtime win-x64
dotnet publish -c Release --runtime linux-x64
dotnet publish -c Release --runtime osx-64
# \bin\Release\net9.0\linux-x64\publish
# \bin\Release\net9.0\win-x64\publish
# \bin\Release\net9.0\osx-x64\publish
./bin/Release/net9.0/Advent.exe --help
./bin/Release/net9.0/Advent.exe day1
./bin/Release/net9.0/Advent.exe day6 --part 2
Expand All @@ -62,10 +57,12 @@ I wrote the code using tests first using the sample data they gave in the exampl
Funny how sometimes you'll get the code working against the test data but then find it fails on the real data.
Seemed to be 50/50 for me.

From repository root:

```sh
dotnet test ./2024/2024.sln
# from root
dotnet test ./2024

# from ./2024
dotnet test
```

## License
Expand Down

0 comments on commit 99df7df

Please sign in to comment.