/AdventOfCode2022

Primary LanguagePythonMIT LicenseMIT

Welcome to FROSTY! ⛄

Questions and Answers

Why is it called like this?

That is a really good question. No one really knows for sure, but there are reports from the North Pole that the elves chose this name because it is an acronym, supposedly standing for

  • F ile
  • R enderer and
  • O nline
  • S ynchroniser for that
  • T ime of
  • Y ear

That makes no sense

I know... If you ask me, the elves just chose the name because of the Christmas song and then tried to fit an acronym to it. Anyways, moving on.

Alright then, how does it help me?

FROSTY can help you by

  • automatically creating new folders for each new day
  • automatically generating boilerplate code for both parts
  • copying the input from the website to a separate file in that day
  • copying the assignment itself into the comments above that part's function block
  • automatically uploading the answer
  • automated waiting before uploading new answer if previous answer was wrong
  • automatically adding the second part to the comment block above the function block of part two if the answer is correct
  • keep a backlog of your previous answers, prohibiting you from answering the same answer twice, thrice, quatr...ice
  • OPTIONALLY prohibiting you from providing answers that are outside of range, if you have had a hint before about answers being to high or low
  • automatically generating and inserting the assignment upon opening of the day, giving you the smallest possible starting delay *cough untested, cough cough*

That sounds amazing! How can I use it?

Everything you need can be found in pull.py. However, we first need to know if you are on Santa's naughty list. Log in to Advent of Code. If you can do that sucessfully, congratulations! No coal for you this year. As soon as you are logged in, copy the token found in the session cookie. This token is valid for about 1 month after logging in.

Next up, run pull.py once, it will automatically generate a .session file. In this file, simply paste your token. At the top of pull.py (line 20) you can select your year. Now, run pull.py again, it will make use of your .session to check for every day in selected year and generate respective folders and files. As soon as it hits a day that is not yet unlocked, it will automatically wait until it opens to continue with the script. To stop this, simply terminate the script.

In the day's folder, you will find input.txt, this is the input as provided by AoC. You will also find main.py with some boilerplate functions, automatically opening the input file for you.

The line advent_of_code.answer(1, None) needs to be replaced to automatically upload your answer. To do this, simply replace None by your answer. As of now, only integer answers support hints. The 1 simply denotes that this is the answer for part 1, as can be seen in the second function, having a 2. If you keep the answer set as None, no call is made to the server and thus it does not incur any time penalties for being wrong.

I have a question?

Feel free to create an issue or contact me in other ways.

I have found an error, what can I do now?

While the elves did their best to code this bug-free, no pythons live on the North Pole. As of such, it is unlikely they know completely what they are doing. If you find any errors or improvements, please don't hesitate to create a PR or issue.

Thank you!

This is not really a question...

I know, but I wanted to say it anyways!

Alright then, you're welcome! Merry Christmas! 🎄