diff --git a/desktop/src-common/advent/action_test2.clj b/desktop/src-common/advent/action_test2.clj index 94fb1d36..51c99b18 100644 --- a/desktop/src-common/advent/action_test2.clj +++ b/desktop/src-common/advent/action_test2.clj @@ -1,5 +1,5 @@ (ns advent.action-test2 - (:require [clojure.core.async :refer [put! ! chan go take! alts!!]])) + (:require [clojure.core.async :refer [put! ! chan go thread take! alts!!]])) (defprotocol IAction (begin [this state]) @@ -30,7 +30,7 @@ (terminate [this state] (put! c state) state))) - c)) + (! action-channel :end)))) + (talk action-channel :ego "I have enough money to buy something") + (talk action-channel :ego "I'm broke.")))))) (defn test-run [] (let [state {:x 0 :y 0 :time 0 :items #{} :current-action nil} action-channel (chan) - actions (run-script state action-channel)] + script (run-script state action-channel) + ] + (script action-channel) (loop [state state current-action nil started? false]