Skip to content

Juro0/adventofcode

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

19 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Advent of Code

My solutions to Advent of Code puzzles, written in Python.

Structure of the repository

๐Ÿ“‚AoC
โ”œโ”€โ”€โ”€ ๐Ÿ“„template.py
โ””โ”€โ”€โ”€ ๐Ÿ“‚YEAR
     โ”œโ”€โ”€โ”€ ๐Ÿ“‚inputs
	 |   โ””โ”€โ”€โ”€ ๐Ÿ“„day-N.txt
     โ””โ”€โ”€โ”€ โš™๏ธday-N.py
  • The file ๐Ÿ“„template.py contains a template for the files with the solution code of the day.
  • The folders ๐Ÿ“‚YEAR (named after the year, e.g. 2024) contain all the files related to the year.
  • The files โš™๏ธday-N.py (where N is the number of the day, e.g. day-1) contain the solution code of the day.
  • The ๐Ÿ“‚inputs folder contains all the input files (named the same way as the solution code files, but with the .txt extension).

The ๐Ÿ“‚inputs folder isn't in the repository's code, according to the Advent of Code ToS, but is required to run the code.

How to run the code

  1. Make sure that you have Python installed on your device.
  2. Clone the repository in your device.
  3. Open the repository using the console of your OS (e.g. cmd for Windows).
  4. Start the desired file using the command python YEAR/day-N.py, replacing YEAR with the year and N with the day of the puzzle you want to see the code (e.g. python 2024/day-1.py).

Before the last step, make sure that you have created the ๐Ÿ“‚inputs folder inside the selected year and that you have created, inside that folder, the day-N.txt file, containing the input of the puzzle. You can get your puzzle input subscribing to Advent of Code and going to the URL https://adventofcode.com/YEAR/day/N/input. As always, YEAR is the year and N is the day of the desired puzzle.

Use of my code

This software is shared as open source. However, if you use it in your own solutions, consider giving acknowledgement to me, linking back this repo.

Contributors

Languages