Skip to content

PrashanthaTP/advent-of-code-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Advent Of Code Challenges

πŸ“‚ Folder Structure

πŸ“‚ aoc
β”œβ”€β”€ πŸ“‚ 2021
β”‚Β Β  β”œβ”€β”€ πŸ“‚ day-1
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ξ˜† SonarSweep.py
β”‚Β Β  β”‚Β Β  └── ο…œ input.txt
β”‚       .
β”‚       .
β”œβ”€β”€ πŸ“‚ 2022
β”‚Β Β  β”œβ”€β”€ πŸ“‚ day-01
β”‚Β Β  β”‚Β Β  β”œβ”€β”€ ξ˜† CalorieCounting.py
β”‚Β Β  β”‚Β Β  └── ο…œ input.txt
β”‚Β Β  └── πŸ“‚ day-02
β”‚Β Β      β”œβ”€β”€ ξ˜† Rock_Paper_Scissors.py
β”‚Β Β      └── ο…œ input.txt
β”‚       .
β”‚       .
β”‚   .
β”‚   .
β”œβ”€β”€ πŸ“‚ scripts
β”‚Β Β  β”œβ”€β”€  create.sh
β”‚Β Β  β”œβ”€β”€ ξ―‡ download_aoc_input.ps1
β”‚Β Β  β”œβ”€β”€  download_aoc_input.sh
β”‚Β Β  └── run.sh
β”œβ”€β”€ πŸ“‚ templates
β”‚Β Β  └── ξ˜† template.py
β”‚       .
β”‚       .
└── πŸ“‚ utils
    β”œβ”€β”€ ξ˜† __init__.py
    β”œβ”€β”€ ξ˜† args.py
    └── ξ˜† utils.py
        .   
        .   

πŸ“ Setup

  • Clone this repository
git clone git@github.com:PrashanthaTP/AdventOfCode.git
  • Change directory
cd aoc
  • Create a virtual environment
python -m venv .
  • Activate virtual environment
source Scripts/activate #this script will be available after venv creation
  • Install current directory as a editable package
pip install -e .

To deactivate virtual environment : deactivate

  • Add your Advent Of Code website's session id in aoc/utils/.env
cp aoc/utils/.env.sample aoc/utils/.env
# replace SESSION value

πŸ“œ Scripts

  • To create a particular day's starting code
./aoc/scripts/create.sh <day num>

which creates these two files input.txt and <que_name>.py inside aoc/<curr year>/day-<day num>

  • To Run a particular day's code
./aoc/scripts/run.sh <day num> -n <part num for the challenge (1 or 2)>

About

Template repository for Advent Of Code Challenges

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published