Last active
August 29, 2015 14:07
-
-
Save c-garcia/b2d85ddd50253cc971b1 to your computer and use it in GitHub Desktop.
Mars-rover kata usage from the REPL
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
(require | |
'[marsrover.grid :as grid] | |
'[marsrover.robot :as robot] | |
'[marsrover.core :refer :all]) | |
;; 10x10 grid with obstacle at 1,1. Robot moves beside it. | |
(let [grid (grid/make-grid [10 10] [[1 1]]) | |
robot (robot/make-robot [0 0] \n grid)] | |
(tell-robot robot "fffrf")) | |
;;{:robot {:pos [1 3], :dir \e, :grid {:dim [10 10], :obstacles {[1 1] true}}}, :status :ok} | |
;; 10x10 grid with obstacle at 1,1. Robot impacts ith it. | |
(let [grid (grid/make-grid [10 10] [[1 1]]) | |
robot (robot/make-robot [0 0] \n grid)] | |
(tell-robot robot "rflfff")) | |
;;{:robot {:pos [1 0], :dir \n, :grid {:dim [10 10], :obstacles {[1 1] true}}}, :status :obstacle-found, :where [1 1]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment