PR submitted!
"Solve problems, not puzzles." Well puzzles are problems except they're fun 😃
Heh. Part 1, was faster to just figure out the nearest 'square' it was in, then do the rest by quick hand math. Part 2... welp, back to actually computing values
what do you mean nearest square?
ah never mind. i didn't realize the third was out. i'm only on the first two so far
Oop
its really neat to read others solutions. much different styles from me. lots of transducers. cgrand's common transducer's lib, lots more comment
macros than me as well
some good use of for
which i almost never use
I tend to finish it quickly for placement, then go back and refactor / tidy in subsequent commits so that the process is still visible in the git history
So the style tends to shift subtly between the early / refined versions
look at this. i didn't even know for loops could do this
https://github.com/thegeez/clj-advent-of-code-2017/blob/master/src/advent/day2.clj#L49
is your stuff in that github repo?
I've got a PR for a link to it
tbf, I checked the for
docs for yesterday's, and it was... underwhelming
It pretty much assumes you have full knowledge of list comprehensions in other langs
mfikes has such a clean style
i think a lot of us have similar ideas
I should really get in the habit of using let bindings and intermediate names over blocks of threading pipelines
@dpsutton Do you mean :while
and :when
? I used that too in day 2: https://github.com/borkdude/aoc2017/blob/master/src/day2.clj#L24
enjoying looking over everyone's solutions this year, learning some stuff! lots of transducer users, something i never really adopted in my own code. wish I had more time to participate this month
Added some docstrings to my day 3 solution: https://github.com/borkdude/aoc2017/blob/master/src/day3.clj
@ajs Usually you don’t really need transducers, it’s more a performance enhancement, but it’s fun to play around with them
I’m becoming curious about @cgrand’s xforms library now too
Today was interesting; I resisted doing part 2 the obvious way in the hope of finding some neat math formula, but eventually gave up.
Yeah, some weird variation of fibonacci maybe 😉
Oh, I have to study your directions
implementation.
Mine is a bit more … explicit 🙂 https://github.com/orestis/adventofcode/blob/master/clojure/aoc/src/aoc/2017_day3.clj
Haha: “no code for today”: https://www.reddit.com/r/adventofcode/comments/7h7ufl/2017_day_3_solutions/dqovogc/
Hah, I did the same thing for the first part! Though I had to write a bit of code to validate my thoughts.
Cool!
This probably from experience on previous AoCs; A lot of times you can avoid a ton of code by teasing out some properties of the input. Though I didn’t know you could search online for sequences of numbers 🙂
LOL, Perl solution for day 2: https://www.reddit.com/r/adventofcode/comments/7h0rnm/2017_day_2_solutions/dqnaxuu/
Clojure sequences are so awesome https://github.com/vvvvalvalval/advent-of-code-2017/blob/master/src/aoc2017/day03.clj
I'm interested in solving some of these with clojure.spec destructuring.
hm
just did the first part of today’s puzzle
9 lines in a repl 😂
@theeternalpulse I did one of those in 2015. Want to see the code?
@theeternalpulse - https://blog.michielborkent.nl/blog/2017/10/10/parsing-a-circuit-with-clojure-spec/ - @thegeez also did one: http://thegeez.net/2016/12/09/parsing_clojure_spec_advent_of_code.html
(co-incidentally, I did not know about Gijs’ blog post after I finished mine)
Wow. The solutions to day 3 no longer have the uniformity seen with days 1 and 2. I think my favorites so fare are the ones by tentamen and moxaj.
@mfikes Cool! I noticed that tentamen’s strategy for day 3 part 1 was isomorphic to mine, but he represented the data more straightforward
When you don't notice the square pattern, the solution becomes different
PureScript solution for comparison: https://github.com/krisajenkins/AdventOfCode/blob/master/src/Year2017/Day3.purs