Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mabenj/aoc-deno-ts
Advent of Code - Deno/TypeScript
https://github.com/mabenj/aoc-deno-ts
aoc-2024-in-deno aoc-2024-in-typescript deno typescript
Last synced: about 1 month ago
JSON representation
Advent of Code - Deno/TypeScript
- Host: GitHub
- URL: https://github.com/mabenj/aoc-deno-ts
- Owner: mabenj
- License: mit
- Created: 2024-12-01T14:51:52.000Z (about 2 months ago)
- Default Branch: master
- Last Pushed: 2024-12-03T23:25:53.000Z (about 2 months ago)
- Last Synced: 2024-12-04T00:18:37.563Z (about 2 months ago)
- Topics: aoc-2024-in-deno, aoc-2024-in-typescript, deno, typescript
- Language: TypeScript
- Homepage: https://adventofcode.com
- Size: 129 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- really-awesome-advent-of-code - mabenj/aoc-deno-ts - commit/mabenj/aoc-deno-ts/master) (🎄 2024 AoC Solutions / Solutions)
README
# 🎄 Advent of Code in Deno/TypeScript
## Prerequisites
- [Deno](https://deno.land/)
## Setup
1. `git clone` this repository
2. `cd` into the repository
3. `deno install -e main.ts` to install the dependencies❗ Note: to start from scratch without my solutions, delete everything inside the `lib` directory except for the `commands` and `types` directories and the `common.ts` file.
## Usage
Solve the puzzle for the given year, day and part:
```
deno main.ts solve [-d, --day ] [-p, --part <1 | 2>] [-y, --year ]
```Initialize and scaffold a new puzzle directory into the `lib` directory:
```
deno main.ts init [-d, --day ] [-y, --year ]
```_Defaults:_
- `day` defaults to the day of the latest puzzle
- `year` defaults to the year of the latest AoC
- `part` defaults to 1❗ Note: to use the `init` command to automatically scaffold a new puzzle directory and to fetch your input and problem description, you will need to set the `AOC_SESSION` environment variable to your Advent of Code session cookie. You can achieve this by creating a `.env` file with `AOC_SESSION=` in the root of your project (see .env.example). This same variable is also used to submit answers after solving a puzzle.
## Testing
`deno test` will run all the solvers and test their output
❗ Note: the tests expect a file `main_test_answers.json` in the `lib/tests` directory with the correct answers for each puzzle. You can use the `main_test_answers.example.json` file as a template to create your own file.