Skip to content

Commit

Permalink
finished colors, closed clojurebridge-boston#19
Browse files Browse the repository at this point in the history
  • Loading branch information
elenam committed Oct 5, 2016
1 parent bdad3f6 commit 9284a4a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/clojurebridge_turtle/core.clj
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
(def trinity {:x 0
:y 0
:angle 90
:color [106 40 126]})
:color [128 0 128]})

;; turtles map
;; {:name {:x x :y y :angle a :color [r g b]}
Expand Down Expand Up @@ -70,8 +70,9 @@
(swap! turtles assoc n {:x 0
:y 0
:angle 90
:color color})))
{n (n @turtles)})))
:color (color-lookup color)})))
(println (str "added turtle" (assoc (update-in (n @turtles) [:color] reverse-lookup) :name n)))
n)))

(defn turtle-names
"returns turtle names"
Expand Down Expand Up @@ -184,7 +185,7 @@
([]
(when-onlyone (state turtle)))
([n]
(assoc (n @turtles) :name n)))
(assoc (update-in (n @turtles) [:color] reverse-lookup) :name n)))


(defn state-all
Expand Down

0 comments on commit 9284a4a

Please sign in to comment.