Created
July 26, 2014 19:07
-
-
Save siscia/4653d6a272a8453b313b to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(defn update-world [world room action] | |
;; if action is something like pick up an object from the room | |
;; I will return a new world without such object in the room, | |
;; if, otherwise, you are moving between some room I will return the same | |
;; world but you will obviously change the room | |
) | |
(loop [world {:roomA {} :roomB {} | |
room :roomA] | |
(let [[new-world next-room] (update-world world room (get-input)) | |
(recur new-world next-room))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment