Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Last commit from 26 Jan Dojo. Added a println to the look.

  • Loading branch information...
commit f4fe36a56a1167722a019d1671d022fc917a671c 1 parent 0727ba4
London Clojure Dojo authored
Showing with 58 additions and 1 deletion.
  1. +1 −1  src/clork.clj
  2. +57 −0 src/repl-history.txt
View
2  src/clork.clj
@@ -38,5 +38,5 @@
(defn west []
(swap! the-player #(move-player % rooms :w))
- (look rooms (:location @the-player)))
+ (println (look rooms (:location @the-player))))
View
57 src/repl-history.txt
@@ -0,0 +1,57 @@
+; SLIME 20091016
+user> (in-ns 'clork)
+#<Namespace clork>
+clork> (def fred (struct player "lobby"))
+#'clork/fred
+clork> fred
+{:room "lobby"}
+clork> (look :kitchen)
+"A kitchern with a roaring fire"
+clork> (move rooms :kitchen :w)
+nil
+clork> (move rooms :kitchen :e)
+nil
+clork> (move rooms :hall :e)
+nil
+clork> (move rooms :hall :n)
+:kitchen
+clork> (player :kitchen)
+; Evaluation aborted.
+clork> (struct player :hall)
+{:location :hall}
+clork> (move-player (struct player :hall) rooms :n)
+; Evaluation aborted.
+clork> (move-player (struct player :hall) rooms :n)
+; Evaluation aborted.
+clork> (move-player (struct player :hall) rooms :n)
+; Evaluation aborted.
+clork> (move rooms :hall :n)
+:kitchen
+clork> (move-player (struct player :hall) rooms :n)
+{:location :kitchen}
+clork> (move-player (struct player :hall) rooms :e)
+{:location nil}
+clork> (move-player (struct player :hall) rooms :e)
+{:location :hall}
+clork>
+nil
+clork>
+nil
+clork> the-player
+; Evaluation aborted.
+clork> the-player
+#<Atom@d2f5f1: {:location :hall}>
+clork> @the-player
+{:location :hall}
+clork> (west)
+{:location :lounge}
+clork> @the-player
+{:location :lounge}
+clork> @the-player
+{:location :hall}
+clork> (west)
+"A lounge with a red chez longue"
+clork> (west)
+A lounge with a red chez longue
+nil
+clork>
Please sign in to comment.
Something went wrong with that request. Please try again.