Skip to content

Commit 09a1df9

Browse files
committed
docs: update readme
1 parent 1e95517 commit 09a1df9

File tree

1 file changed

+55
-30
lines changed

1 file changed

+55
-30
lines changed

README.md

Lines changed: 55 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,56 @@
11
# [Advent of Code](https://adventofcode.com/)
2-
## Get started
3-
Save your session key into `.env` file in the root folder as below:
4-
```
5-
SESSION=abc...
6-
```
7-
Start solving problems
8-
```
9-
npx @nguyenhuu/adventofcode@latest -d <day> -p <part> -y <year> -l <language>
10-
```
11-
Example:
12-
```
13-
npx @nguyenhuu/adventofcode@latest -d 1 -p 1 -y 2023 -l python
14-
```
15-
## Hot keys
16-
* **s** : Using sample.txt as input
17-
* **i** : Using input.txt as input
18-
* **u** : Submit the most recent result
19-
* **0** -> **9** : Select part
20-
* **c** : Clear terminal
21-
* **q** : Quit program
22-
* **x** : Terminate solution
23-
* **Enter** : Re-run solution
24-
* **h** : Show helps
25-
26-
## Supported languages
27-
> Need an installed runtime!
28-
* Javascript
29-
* Python
30-
* Golang
31-
* Java
2+
3+
## About This Repository
4+
5+
This repository contains solutions to Advent of Code problems, which is an annual programming challenge that runs from December 1st to December 25th. Each day presents two programming puzzles that test your problem-solving skills and coding abilities. The problems start simple and gradually increase in difficulty, making it perfect for both beginners and experienced programmers.
6+
7+
## Personal Context
8+
9+
I created this repository as part of teaching my son, **Gia Vinh** (11 years old), Python programming. I chose Advent of Code as our learning platform because it offers engaging, practical problems that are more interesting and motivating than traditional theory-based learning. Each puzzle provides a real-world context that makes learning programming concepts more tangible and fun.
10+
11+
Most of the solutions in this repository are written by Gia Vinh as part of his learning journey. You can see his progress through the commit history, where he gradually improves his coding style and problem-solving approaches. This repository serves as a living documentation of his growth as a young programmer, from his first attempts at solving simple puzzles to tackling more complex challenges.
12+
13+
Note: Sharing solutions is not against Advent of Code's policy, as they encourage learning and discussion within the community.
14+
15+
## About the Tool
16+
17+
This repository uses a custom CLI tool (`@nguyenhuu/adventofcode`) that makes solving Advent of Code problems more efficient and enjoyable. The tool provides several key features:
18+
19+
- **Easy Setup**: Just install the package and configure your session key
20+
- **Automatic Test Data**: Automatically fetches test data from Advent of Code website
21+
- **Multiple Language Support**: Write solutions in Python, JavaScript, Go, or Java
22+
- **Interactive Mode**: Real-time solution testing and submission
23+
- **Hot Keys**: Quick access to common operations like switching between sample/real input, submitting solutions, and more
24+
25+
## Quick Guide
26+
27+
1. **Install the Tool**
28+
```bash
29+
npm install -g @nguyenhuu/adventofcode
30+
```
31+
32+
2. **Get Your Session Key**
33+
- Log in to [Advent of Code](https://adventofcode.com)
34+
- Open browser dev tools (F12)
35+
- Go to Application tab → Cookies
36+
- Copy the value of the `session` cookie
37+
38+
3. **Configure Your Environment**
39+
- Create a `.env` file in your project root
40+
- Add your session key: `SESSION=your_session_key_here`
41+
42+
4. **Start Solving**
43+
```bash
44+
adventofcode -d 1 -p 1 -y 2023 -l python
45+
```
46+
47+
5. **Use Hot Keys**
48+
- Press `s` to test with sample input
49+
- Press `i` to test with real input
50+
- Press `u` to submit your solution
51+
- Press `h` for help
52+
53+
![demo](https://cdn.huu.app/images/adventofcode-runner.png)
54+
55+
For more detailed information about the tool's features and configuration options, visit the [official repository](https://www.npmjs.com/package/@nguyenhuu/adventofcode).
56+

0 commit comments

Comments
 (0)