Comments (8)
Hey, yeah this is not too hard, the first function in the create_aoc_tiles.py
script is exactly meant for that:
adventofcode/AoCTiles/create_aoc_tiles.py
Lines 68 to 107 in daf8aae
So:
- Put the AoCTiles folder in your repository
- Install requirements:
pip install requirements.txt
- Change that function
get_solution_paths_dict_for_years()
to this (I have modified it so it works for your structure, it shouldn't need to be changed):
def get_solution_paths_dict_for_years() -> dict[int, dict[int, list[str]]]:
solution_paths_dict: dict[int, dict[int, list[str]]] = {}
year = 2022
solution_paths_dict[year] = {}
for solution_path in AOC_DIR.rglob("src/solutions/day*.rs"):
day = find_first_number(solution_path.name)
solution_paths_dict[year][day] = [solution_path.relative_to(AOC_DIR).as_posix()]
return solution_paths_dict
- Add
<!-- AOC TILES BEGIN -->
and<!-- AOC TILES END -->
to your README.md - Put your session cookie in the root folder of the repository into the file
session.cookie
(do NOT commit this) - Commit the files in
Media
and the README.md. Commiting the AoCTiles folder is optional. - (Optional, if you want to add the images on each commit: add my
.pre-commit-config.yaml
to your repository and install withpre-commit install
)
from adventofcode.
Thank you so much! I really appreciate you taking the time to help me with this. I will try it out!
from adventofcode.
Seems as if the the line: solution_paths_dict[year][day] = solution_path.relative_to(AOC_DIR).as_posix()
has some syntax error or something? Does this need to be run on a linux environment of some sort?
from adventofcode.
Can you add the error here?
from adventofcode.
Hi @LiquidFun Apologies. I figured out the issue. I was running Python 3.8, it needed Python 3.10 or newer, doing so resolved all issues. Thank you!!!
from adventofcode.
Oh sorry, apparently I do get a multicolored image with a bunch of file extensions instead of just .rs
and a singular colour. I think that it is picking up random file extensions outside the solutions folder?
from adventofcode.
oops, yeah, my mistake, I forgot that it needs to be a list. The function needs to be like this:
def get_solution_paths_dict_for_years() -> dict[int, dict[int, list[str]]]:
solution_paths_dict: dict[int, dict[int, list[str]]] = {}
year = 2022
solution_paths_dict[year] = {}
for solution_path in AOC_DIR.rglob("src/solutions/day*.rs"):
day = find_first_number(solution_path.name)
solution_paths_dict[year][day] = [solution_path.relative_to(AOC_DIR).as_posix()]
return solution_paths_dict
The only difference is in the second to last line, I added [] around the solution.
from adventofcode.
Perfect, thank you so much!
from adventofcode.
Related Issues (5)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from adventofcode.