|
Ooh, I'm always up for some coding challenges.
|
# ¿ Dec 4, 2015 15:42 |
|
|
# ¿ May 11, 2024 14:48 |
|
A bunch of people are putting up visualizations of the Day 3 answer. Spoilers obviously. http://snk.digibase.ca/advent3.html It's pretty neat looking.
|
# ¿ Dec 4, 2015 20:09 |
|
Well I forced myself to learn regex this weekend, so I suppose I got something of all this. Took this opportunity to mess around with Python as well.
|
# ¿ Dec 7, 2015 14:44 |
|
Munkeymon posted:I think that's what I'm going to have to do. My first attempt has been to transpile it to JS (bn RSHIFT 2 -> bo => function bo_wire(){return bn_wire() >> 2;}) and let the interpreter figure out the graph for me but that's so loving slow I left it running all day and it hadn't finished, which I expected problem 5 to do, but nooo - that took whole seconds. Second attempt was changing the transpiler to emit F# and then try to sort the calls to make it a valid F# program (single-pass compilers in tyool 2015!), but I can't get that second part of that right and doing it by hand? Bleh https://github.com/JohnWang42/Advent-Code-Solutions/blob/master/day7.py Mine's in python, but what I did was take each unique value and add make it into an object. Each object stores the values and the operator. If the value is an unknown variable, it'll run the recursive resolve function on it when I want to get the value of a particular variable. Now the trick to making not run like poo poo was to also store the value of the variable once it was fully resolved. That way I'm not solving for the same drat thing a million times over.
|
# ¿ Dec 14, 2015 17:23 |
|
I never finished last year's stuff, so luckily I have things to do after I finish this year's easy beginning puzzles! I inadvertently solved both parts of the Day 8 today when I made a visualizer to help debug the first part. My python solutions
|
# ¿ Dec 8, 2016 22:45 |