This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2017-12-03
Channels
- # adventofcode (49)
- # bangalore-clj (1)
- # beginners (56)
- # berlin (1)
- # chestnut (6)
- # cljs-dev (5)
- # clojure (48)
- # clojure-greece (29)
- # clojure-russia (3)
- # clojure-spec (5)
- # clojure-uk (3)
- # clojurescript (28)
- # cursive (25)
- # emacs (3)
- # fulcro (123)
- # hoplon (2)
- # klipse (6)
- # off-topic (146)
- # om (11)
- # re-frame (29)
- # reagent (7)
- # reitit (3)
- # specter (11)
- # unrepl (4)
- # yada (3)
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
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
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
https://github.com/thegeez/clj-advent-of-code-2017/blob/master/src/advent/day2.clj#L49
It pretty much assumes you have full knowledge of list comprehensions in other langs
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
Today was interesting; I resisted doing part 2 the obvious way in the hope of finding some neat math formula, but eventually gave up.
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.
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.
@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
I'll check it out, I think this was posted on a thread in reddit I had made.
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
PureScript solution for comparison: https://github.com/krisajenkins/AdventOfCode/blob/master/src/Year2017/Day3.purs