我正在尝试创建一个基于文本的 Clojure 游戏(灵感来自 Lisp 之国)。
(def *nodes* {:living-room "you are in the living-room. a wizard is snoring loudly on the couch."
:garden "you are in a beautiful garden. there is a well in front of you."
:attic "you are in the attic. there is a giant welding torch in the corner."})
(defn describe-location [location nodes]
(nodes location))
代码在 REPL 中运行,但如果我将代码保存到文件并尝试运行:
(describe-location :attic *nodes*)
我有:
线程“main”java.lang.IllegalArgumentException 中的异常:传递给的 args (1) 数量错误:user$describe-location (wizard-game.clj: 0)
我做错了什么?
这是文件:http ://dl.dropbox.com/u/3630641/wizard-game.clj