This is a Next.js project bootstrapped with create-next-app
.
This project is done as a simple helper for Advent of Code challenges allowing to run the code in the browser, visualize puzzles and your answers. This project is not of high code quality and challenges answers are not meant to be optimal.
If you want to learn more about AoC - visit Advent of Code website.
- Create your own
.env
file in the root of the project - Check your cookies in the
https://adventofcode.com
, copy thesession
cookie value asAOC_TOKEN
variable in.env
file - Create a year folder in
pages/days
(i.e.pages/days/2020
) - Add
{number}.tsx
files for each day you want to solve (i.e.pages/days/2020/1.tsx
) - Each day file should export default React component returning
PuzzleRenderer
element PuzzleRenderer
element should havefunc
prop with a function that solves the puzzle (it will receive the puzzle input as a string)
import { PuzzleRenderer } from '../../../components/PuzzleRenderer';
const solve = (input: string) => {
// your code here
};
export default function Day() {
return <PuzzleRenderer func={solve} />;
}