adventofcode

Happy Advent 2020! Please put answers in the pinned threads or create one if it does not exist yet. | https://github.com/adventofcode-clojurians/adventofcode-clojurians | Join the private leaderboard with code 217019-4a55b8eb
abarylko 2017-12-03T02:00:36.000085Z

PR submitted!

jmb 2017-12-03T03:47:20.000026Z

"Solve problems, not puzzles." Well puzzles are problems except they're fun 😃

fellshard 2017-12-03T05:35:51.000031Z

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

dpsutton 2017-12-03T05:38:26.000024Z

what do you mean nearest square?

dpsutton 2017-12-03T05:40:02.000093Z

ah never mind. i didn't realize the third was out. i'm only on the first two so far

fellshard 2017-12-03T05:41:58.000069Z

Oop

dpsutton 2017-12-03T05:45:49.000034Z

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

dpsutton 2017-12-03T05:46:14.000039Z

some good use of for which i almost never use

fellshard 2017-12-03T05:46:50.000019Z

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

fellshard 2017-12-03T05:47:15.000062Z

So the style tends to shift subtly between the early / refined versions

dpsutton 2017-12-03T05:47:37.000054Z

look at this. i didn't even know for loops could do this

dpsutton 2017-12-03T05:48:09.000031Z

is your stuff in that github repo?

fellshard 2017-12-03T05:50:49.000068Z

I've got a PR for a link to it

fellshard 2017-12-03T05:50:51.000033Z

https://github.com/armstnp/advent-of-code-2017

fellshard 2017-12-03T05:51:08.000021Z

tbf, I checked the for docs for yesterday's, and it was... underwhelming

fellshard 2017-12-03T05:51:26.000005Z

It pretty much assumes you have full knowledge of list comprehensions in other langs

dpsutton 2017-12-03T05:52:05.000081Z

mfikes has such a clean style

dpsutton 2017-12-03T05:53:53.000064Z

i think a lot of us have similar ideas

dpsutton 2017-12-03T05:53:54.000020Z

https://github.com/dpsutton/advent

fellshard 2017-12-03T06:03:09.000041Z

I should really get in the habit of using let bindings and intermediate names over blocks of threading pipelines

theeternalpulse 2017-12-03T06:25:37.000025Z

https://github.com/deepee0086-clj/adventofcode-clojurians

borkdude 2017-12-03T11:41:05.000056Z

@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

ajs 2017-12-03T11:46:07.000069Z

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

borkdude 2017-12-03T11:59:18.000040Z

Added some docstrings to my day 3 solution: https://github.com/borkdude/aoc2017/blob/master/src/day3.clj

borkdude 2017-12-03T12:09:09.000042Z

@ajs Usually you don’t really need transducers, it’s more a performance enhancement, but it’s fun to play around with them

borkdude 2017-12-03T12:10:08.000031Z

I’m becoming curious about @cgrand’s xforms library now too

orestis 2017-12-03T12:39:08.000030Z

Today was interesting; I resisted doing part 2 the obvious way in the hope of finding some neat math formula, but eventually gave up.

borkdude 2017-12-03T12:40:09.000019Z

Yeah, some weird variation of fibonacci maybe 😉

orestis 2017-12-03T12:41:25.000007Z

Oh, I have to study your directions implementation.

orestis 2017-12-03T12:45:38.000046Z

Mine is a bit more … explicit 🙂 https://github.com/orestis/adventofcode/blob/master/clojure/aoc/src/aoc/2017_day3.clj

borkdude 2017-12-03T12:45:49.000022Z

Haha: “no code for today”: https://www.reddit.com/r/adventofcode/comments/7h7ufl/2017_day_3_solutions/dqovogc/

orestis 2017-12-03T12:46:42.000065Z

Hah, I did the same thing for the first part! Though I had to write a bit of code to validate my thoughts.

borkdude 2017-12-03T12:48:18.000049Z

Cool!

orestis 2017-12-03T12:52:57.000036Z

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 🙂

borkdude 2017-12-03T13:19:03.000019Z

LOL, Perl solution for day 2: https://www.reddit.com/r/adventofcode/comments/7h0rnm/2017_day_2_solutions/dqnaxuu/

val_waeselynck 2017-12-03T15:07:05.000033Z

Clojure sequences are so awesome https://github.com/vvvvalvalval/advent-of-code-2017/blob/master/src/aoc2017/day03.clj

theeternalpulse 2017-12-03T17:18:54.000038Z

I'm interested in solving some of these with clojure.spec destructuring.

2017-12-03T17:23:52.000069Z

hm

2017-12-03T17:24:00.000081Z

just did the first part of today’s puzzle

2017-12-03T17:24:56.000011Z

9 lines in a repl 😂

borkdude 2017-12-03T17:44:49.000095Z

@theeternalpulse I did one of those in 2015. Want to see the code?

borkdude 2017-12-03T17:47:54.000087Z

(co-incidentally, I did not know about Gijs’ blog post after I finished mine)

mfikes 2017-12-03T18:37:51.000017Z

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.

borkdude 2017-12-03T19:34:17.000125Z

@mfikes Cool! I noticed that tentamen’s strategy for day 3 part 1 was isomorphic to mine, but he represented the data more straightforward

borkdude 2017-12-03T19:35:07.000005Z

When you don't notice the square pattern, the solution becomes different

borkdude 2017-12-03T19:36:20.000002Z

PureScript solution for comparison: https://github.com/krisajenkins/AdventOfCode/blob/master/src/Year2017/Day3.purs

👍 1