This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2018-11-27
Channels
- # adventofcode (1)
- # announcements (4)
- # beginners (120)
- # calva (5)
- # cider (12)
- # clara (3)
- # cljdoc (48)
- # cljs-dev (33)
- # cljsrn (4)
- # clojure (124)
- # clojure-dev (43)
- # clojure-europe (2)
- # clojure-italy (168)
- # clojure-nl (2)
- # clojure-spec (7)
- # clojure-uk (79)
- # clojurescript (50)
- # core-logic (6)
- # cursive (12)
- # datascript (1)
- # datomic (8)
- # devcards (2)
- # emacs (5)
- # events (2)
- # figwheel-main (6)
- # fulcro (18)
- # graphql (42)
- # hyperfiddle (3)
- # jobs (1)
- # luminus (2)
- # nrepl (5)
- # off-topic (59)
- # onyx (5)
- # parinfer (2)
- # pathom (10)
- # pedestal (2)
- # portkey (3)
- # re-frame (24)
- # reagent (6)
- # reitit (54)
- # remote-jobs (1)
- # ring (5)
- # shadow-cljs (75)
- # spacemacs (35)
- # sql (22)
- # tools-deps (16)
- # unrepl (10)
here’s the actual thing:
(run* [q]
(init vars legs)
(with-fresh
(membero ?1 vars)
(membero ?2 vars)
(membero ?3 vars)
(membero ?4 vars)
(== ?1 ["M" ?a1 ?b1])
(== ?2 ["T" ?a2 ?b2])
(== ?3 ["W" ?a3 ?b3])
(== ?4 ["R" ?a4 ?b4])
(== ?b1 ?a2)
(== ?b2 ?a3)
(== ?b3 ?a4)
(== q [?1 ?2 ?3 ?4]))))
vars
is a collection of tuples like this: ["M" "SAN_ANTONIO" "HOUSTON"]
(day of week, start, end)
I’m messing around with a core.logic solution to https://kevinlynagh.com/notes/shipping-puzzle/