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
bhauman 2016-12-06T02:19:17.000050Z

Hey all, I've got my repo up https://github.com/bhauman/advent-of-clojure-2016 there's also a link to last years solutions as well. I'm open to discussion.

👍 2
bhauman 2016-12-06T02:22:08.000052Z

@samueldev ^

fellshard 2016-12-06T05:04:24.000055Z

PFFF. And done.

👍 1
fellshard 2016-12-06T05:04:39.000056Z

Clojure was made for this ❤️

fellshard 2016-12-06T05:04:44.000057Z

Well, LISP

andrew.sinclair 2016-12-06T05:18:02.000058Z

Yeah that was easiest so far...

abarylko 2016-12-06T05:22:07.000059Z

what rank did you get?

andrew.sinclair 2016-12-06T05:24:03.000060Z

I got 459 and 419. It is my best total for one day, but not my best for any 1 part.

fellshard 2016-12-06T05:24:44.000061Z

45 and 37 😄

andrew.sinclair 2016-12-06T05:25:04.000062Z

awesome!

fellshard 2016-12-06T05:25:14.000063Z

Transpose once again saves the day, so glad I have that stowed in my core for this

andrew.sinclair 2016-12-06T05:25:33.000064Z

ahh transpose...

andrew.sinclair 2016-12-06T05:26:32.000065Z

I will refactor to use that... I wrote my own and called it pivot.

andrew.sinclair 2016-12-06T05:26:42.000066Z

See I'm learning already!

andrew.sinclair 2016-12-06T05:26:49.000067Z

Thank you 😉

fellshard 2016-12-06T05:31:41.000068Z

That's a good name too 😄

fellshard 2016-12-06T05:32:00.000069Z

I'm just used to calling it transpose from matrix algebra hahah

abarylko 2016-12-06T06:22:56.000070Z

Is there a transpose ?

fellshard 2016-12-06T07:04:03.000071Z

Not in the core lib, I just have one defined in my core file for quick importing, since these problems seem to use it frequently

fellshard 2016-12-06T07:04:40.000072Z

(defn transpose
  "Transposes the given nested sequence into nested vectors, as
  in matrix transposition.  E.g., (transpose [[1 2 3] [4 5 6]])
  would return [[1 4] [2 5] [3 6]]."
  [s]
  (vec (apply map vector s)))

fellshard 2016-12-06T07:05:02.000073Z

Presumes rectangular input.

abarylko 2016-12-06T07:17:20.000075Z

Oh I did that as well

andrew.sinclair 2016-12-06T15:12:02.000077Z

I found a transpose in clojure.core.matrix but then I ended up using (apply mapv vector data)

fellshard 2016-12-06T16:16:24.000080Z

Oooh I forgot about mapv, good call...