Permalink
Browse files

Mire: move roomish code to rooms.clj

  • Loading branch information...
1 parent a98bce4 commit 0b5f2460e489fc6a465e6324b38a0dffdbd7bdd9 Andreas Pauley committed Dec 19, 2009
Showing with 8 additions and 4 deletions.
  1. +3 −4 PeepCode/Clojure/mire/src/mire/commands.clj
  2. +5 −0 PeepCode/Clojure/mire/src/mire/rooms.clj
@@ -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))
@@ -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.