This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2019-12-31
Channels
- # adventofcode (15)
- # announcements (8)
- # babashka (16)
- # beginners (48)
- # braveandtrue (5)
- # calva (54)
- # cider (7)
- # clara (8)
- # clj-kondo (3)
- # cljdoc (3)
- # clojure (37)
- # clojure-europe (1)
- # clojure-italy (15)
- # clojure-losangeles (2)
- # clojure-nl (15)
- # clojure-uk (6)
- # clojurescript (145)
- # community-development (53)
- # cursive (20)
- # data-science (8)
- # datomic (23)
- # duct (2)
- # emacs (22)
- # fulcro (16)
- # gorilla (7)
- # graalvm (7)
- # hoplon (1)
- # malli (7)
- # off-topic (8)
- # rewrite-clj (2)
- # ring (9)
- # spacemacs (2)
- # specter (1)
- # tools-deps (25)
- # vrac (1)
Can unfortunately not see the history for day 15 here nor on clojureverse, but here’s mine: https://github.com/transducer/adventofcode/blob/master/src/adventofcode/2019/day15.clj
Looks like I’m not going to get around porting my Haskell intcode computer to Clojure since every other assignment seems to be using that.
For day 10 I saw one solution with some floating point arithmetic, but wouldn’t the cleaner way be to sieve out?
If from a position, there is an asteroid at +2,+1, then all multiples of that position would be occluded so: +4,+2, +6,+3 etc.
(Doesn’t work for right angles unfortunately. An asteroid at +2,+0 also occludes one at +3,+0.)
A native ratio type is nice. But the approach I saw was to calculate the angle to all others asteroids and then count only the uniques since if any number of asteroids are on the same angle, only one of them will be visible.
The the only thing left is to calculate an angle on 2PI with ratios (or to munge floats after all).
I’ll have to pick up my trig to see whether this is possible.
For error-proof method, you can sort every asteroids clockwise (or counter clockwise) using cross product. It only requires integer arithmetics.
What’s the cross product quality that I would be exploiting here? I’ve never had a good feeling for it.