Source code: Lib/fileinput.py This module implements a helper class and functions to quickly write a loop over standard input or a list of files. If you just want to read or write one file see open...
I didn't get around to this until much later in the day. I'm pleased with how small the my solutions were, though I'm certain it could be done in fewer CPU cycles with a more clever design.
Ooof, the difficulty spiked for this one! Recusion has always been a weakness of mine, it's hard for me to reason through it. Parsing lines is much more my speed!
Wow, that felt really satisfying to finish! Writing little virtual devices like this gives me a taste of how I assume @neauoire felt working on the uxn VM!
Noelle
in reply to Noelle • • •Content warning: AoC Day 1
I’m gonna try to take advantage of the fileinput module this year for simpler file reading in Python
https://docs.python.org/3.11/library/fileinput.html
#AdventOfCode
fileinput — Iterate over lines from multiple input streams
Python documentationNoelle
in reply to Noelle • • •Content warning: AoC Day 2
This definitely isn't as clever as it could be, but I couldn't reason out a more elegant way to do things 🙁
#AdventOfCode
~noelle/aoc-2022: 02/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 3
I was up late anyways, so I thought "why not try to beat @sejo for day 3 on the merveilles leaderboard?"
~noelle/aoc-2022: 03/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 4
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/04
~noelle/aoc-2022: 04/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 5
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/05
~noelle/aoc-2022: 05/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 6
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/06
~noelle/aoc-2022: 06/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 7
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/07
~noelle/aoc-2022: 07/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 8
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/08
~noelle/aoc-2022: 08/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 9
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/09
~noelle/aoc-2022: 09/ - sourcehut git
git.sr.htNoelle
in reply to Noelle • • •Content warning: AoC Day 10
https://git.sr.ht/~noelle/aoc-2022/tree/main/item/10
~noelle/aoc-2022: 10/ - sourcehut git
git.sr.htDevine Lu Linvega
in reply to Noelle • • •Content warning: AoC Day 10
I made a similar one a few months back: https://wiki.xxiivv.com/site/turquoise.html
XXIIVV — turquoise
wiki.xxiivv.com