PrashanthaTP / advent-of-code-template

Template repository for Advent Of Code Challenges

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

License:MIT License


Languages

Language:Shell 66.4%Language:Python 32.2%Language:PowerShell 1.4%