This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
- # adventofcode (93)
- # beginners (104)
- # boot (1)
- # cider (4)
- # cljsjs (2)
- # clojure (174)
- # clojure-austin (1)
- # clojure-greece (5)
- # clojure-spec (13)
- # clojure-uk (32)
- # clojurescript (15)
- # core-logic (13)
- # cursive (13)
- # data-science (8)
- # datomic (11)
- # duct (1)
- # fulcro (22)
- # instaparse (23)
- # jobs (1)
- # lein-figwheel (5)
- # off-topic (13)
- # onyx (13)
- # parinfer (1)
- # pedestal (19)
- # re-frame (33)
- # specter (26)
- # unrepl (22)
Hmz. My program for part 1 works for the examples but somehow not for my real input. I get an answer, but it’s wrong.
[0 1 2 3 4 5 6 7 8 9101112131415] [a b c d e f g h i j k l m n o p] [a b c k e f g h i j d l m n o p] :EXCHANGE (3 10) CORRECT [a b c k e f l h i j d g m n o p] :PARTNER (l g) CORRECT [h i j d g m n o p a b c k e f l] :SPIN (9) CORRECT [h i j d g m l o p a b c k e f n] :EXCHANGE (6 15) CORRECT [l o p a b c k e f n h i j d g m] :SPIN (10) CORRECT
My parser seems to be correct: when I coerce the parsed tree back to a string and compare to the input, it’s equal
My solutions to day 16, including an exploration / explanation of the algebraic properties that make part 2 viable https://github.com/vvvvalvalval/advent-of-code-2017/tree/master/src
Do you have any links to where I can read up on this? I understand how the cyclic nature would lead you to the right answer, but I'm not sure I see how we can assume the dance itself is idempotent.
Ohh, wait. Because the possible permutations operations are limited, there are far fewer than 1e13 operations that can be performed?
@nooga Looking at your code, I find something peculiar; do you want to know or want to battle it?
From past experience, this is probably going to be one of those puzzles where a lot of people will drop off; I find no shame in stealing the answer from someone and moving on though 🙂
I still haven’t done day 14, my knot-hash fn is slow and somehow I get wrong answers, too complex to debug for now
I tried to compile the input into something like
(fn [initial-state] (-> initial-state (S 1) (X 1 3) ...)) and then evaling it for fun but it just caused a stack overflow in clojure compiler
no its normally from nested lazy seqs that grow to large by the time you start to consume them
so basically the code I'm looking at is different from the code you were using earlier
anyway asking for a billion was a dead give away, it would have been brutal if they asked for something just outside of plausible
Yeah, while part 1 can be tedious, it is straightforward. Part 2 had nice characteristics.
Hand-written parser: ~8ms https://github.com/borkdude/aoc2017/blob/master/src/day16.clj#L119
Interesting. I've got a solution which works for part-1, gives me the correct period for part-2, but not the correct answer for part-2. It's two transpositions off. And it doesn't look like an off-by-one error, as neither solution on either side is correct either.
I always make the mistake of thinking this syntax exists b/c we have such an awesome reader, but alas I'm always wrong
Added a Kern parser implementation for day 16: https://github.com/borkdude/aoc2017/blob/master/src/day16.clj#L115
Nothing like a 26-hours plane trip to catch up on AoC 🙂 I know I'm late to the party, but I wonder what you guys thought of day 11 (Haxagonal Grid)? Did you find it difficult? It took me a lot of head scratching to achieve a clean solution, and even then if feels like it could be simpler (here if you're curious: https://github.com/vvvvalvalval/advent-of-code-2017/blob/master/src/aoc2017/day11.clj)