Skip to content

Commit

Permalink
Mire: move roomish code to rooms.clj
Browse files Browse the repository at this point in the history
  • Loading branch information
Andreas Pauley committed May 26, 2010
1 parent a98bce4 commit 0b5f246
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 3 additions & 4 deletions PeepCode/Clojure/mire/src/mire/commands.clj
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
(ns mire.commands
(:use [mire rooms])
(:use [clojure.contrib str-utils]))

(defn move
"We gotta get out of this place... Give a direction."
[direction]
(str "You are trying to go " direction))

(def *current-room*
{:desc "You don't know where you are. You can't see anything."})

(defn look []
"Get a description of the current room"
(:desc *current-room*))
(str (:desc *current-room*)
"\nExits: " (keys (:exits *current-room*))))

(def commands {:move move,
:north (fn [] (move :north))
Expand Down
5 changes: 5 additions & 0 deletions PeepCode/Clojure/mire/src/mire/rooms.clj
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
(ns mire.rooms)

(def *current-room*
{:desc "You don't know where you are. You can't see anything."
:exits {:nowhere "You can run but you can't hide..."}})

0 comments on commit 0b5f246

Please sign in to comment.