Skip to content

Instantly share code, notes, and snippets.

View bgrabow's full-sized avatar

Ben Grabow bgrabow

View GitHub Profile
@bgrabow
bgrabow / atom-clojure-setup.md
Last active November 29, 2019 23:40
Atom Clojure Party REPL setup guide

Atom Clojure Party REPL Setup

This is a beginner-friendly Clojure setup for Atom, with a minimal set of package dependencies and custom keybindings. Credit goes to @jasongilman for his excellent ProtoREPL setup guide, from which I copied much of the content for this guide.

There are many improvements that can be made to this setup as you gain experience with Atom, Clojure, and related packages, but this guide is intended to focus on the essential basics a beginner needs for a smooth REPL-driven workflow.

Jump down to Configuration summary for the TL;DR if you're already comfortable configuring Atom.

Install Atom

(defn monoid [id fn-2]
(fn [& args]
(reduce fn-2 id args)))
(ns aoc.y2018.d17.bgrabow
(:refer-clojure :exclude [read-string format])
(:require
[aoc.utils :as u :refer [deftest read-string format]]
;[aoc.y2018.d17.data :refer [input answer-1 answer-2]]
[clojure.test :as t :refer [is testing]]
[clojure.string :as str]
[clojure.set :as set]))
(def test-input "x=495, y=2..7\ny=7, x=495..501\nx=501, y=3..7\nx=498, y=2..4\nx=506, y=1..2\nx=498, y=10..13\nx=504, y=10..13\ny=13, x=498..504")
(defn refil-available-tasks [{:keys [visited graph open-tasks available-tasks timer workers task-cost] :as the-data}]
{:visited visited :timer timer :workers workers :task-cost task-cost :open-tasks open-tasks :graph graph
:available-tasks (into available-tasks (get-available-nodes graph open-tasks available-tasks))})
; Change this ^ to this v
(defn refil-available-tasks [{:keys [graph open-tasks available-tasks] :as the-data}]
(-> the-data
(update :available-tasks #(conj % (get-available-nodes graph open-tasks available-tasks)))))