Skip to content
This repository has been archived by the owner on Aug 17, 2024. It is now read-only.

1npo/aoc2022-py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Advent of Code 2022 (Python)

Install

% git clone https://github.com/1npo/aoc2022-py.git
% cd aoc2022-py
% pip install .

Show solutions

Each puzzle has two solutions: One written in pure Python, and the other using Pandas dataframes. The pure Python solution will run by default. To run the Pandas dataframe solution, add the --pandas flag (or -p for short) to the following commands:

Show solutions for all days

Use the --all flag (or -a for short), eg:

% aoc2022 -a
[!] Solving the puzzle for all days.
[!] December 1...
[+] Part 1 answer: 69795
[+] Part 2 answer: 208437

...

Show solutions for a given day

Use the --day flag (or -d for short), and provide a day number (1-31), eg:

% aoc2022-py -d 1
[!] Solving the puzzle for December 1...
[+] Part 1 answer: 69795
[+] Part 2 answer: 208437

Add Solutions

(NOTE: N = the day in December)

  1. Save the puzzle input in aoc2022/days/inputs/ with the filename dayN.txt.
  2. Write a module in aoc2022/days/ that...
    • Has the filename dayN.py
    • Includes a solver() function that takes a file path (str) argument
  3. Implement the logic for solving the puzzle in solver()
  4. Solve the puzzle with aoc2022-py -d N
  5. Profit!

About

Advent of Code 2022 (Python)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages