moved test-programs out of test into src, renamed it src-programs

also fixed some testing bugs that were using
the old parameters for init-world
This commit is contained in:
Richard Harrington 2013-08-20 12:21:09 -04:00
parent 9b46900f9b
commit d7d27ca9f0
6 changed files with 10 additions and 10 deletions

View File

@ -1,6 +1,6 @@
(ns robotwar.core
(:use [clojure.pprint :only [pprint]])
(:require [robotwar.test-programs :as test-programs]
(:require [robotwar.source-programs :as source-programs]
[robotwar.world :as world]
[robotwar.register :as register]
[robotwar.robot :as robot]
@ -12,7 +12,7 @@
(def progs
(repeat 3 (:moving-to-spot test-programs/programs)))
(repeat 3 (:moving-to-spot source-programs/programs)))
(def world
(world/init-world progs))
(defn combined-worlds []

View File

@ -4,7 +4,7 @@
[ring.middleware.json :as middleware]
[ring.util.response :as response]
[compojure.route :as route]
[robotwar.test-programs :as test-programs]
[robotwar.source-programs :as source-programs]
[robotwar.world :as world]
[robotwar.browser :as browser]))
@ -23,7 +23,7 @@
; in the browser, not hard-coded here.
(def progs
(repeat 3 (:moving-to-spot test-programs/programs)))
(repeat 3 (:moving-to-spot source-programs/programs)))
(def world
(world/init-world progs))
(defn combined-worlds []
@ -32,7 +32,7 @@
(def worlds (agent (browser/worlds-for-browser (combined-worlds))))
(defroutes app-routes
(GET "/programs" [] (response/response test-programs/programs))
(GET "/programs" [] (response/response source-programs/programs))
(GET "/worlds/:n" [n] (response/response
(take-drop-send worlds (Integer/parseInt n))))
(route/files "/")

View File

@ -1,4 +1,4 @@
(ns robotwar.test-programs)
(ns robotwar.source-programs)
(def programs
{:multi-use

View File

@ -4,10 +4,10 @@
[robotwar.brain])
(:require [robotwar.world :as world]
[robotwar.register :as register]
[robotwar.test-programs :as test-programs]))
[robotwar.source-programs :as source-programs]))
(def initial-world
(world/init-world 256.0 256.0 [(:multi-use test-programs/programs)]))
(world/init-world [(:multi-use source-programs/programs)]))
(def combined-worlds (world/build-combined-worlds initial-world))

View File

@ -4,7 +4,7 @@
[robotwar.register])
(:require [robotwar.world :as world]))
(def world (world/init-world 256.0 256.0 [""]))
(def world (world/init-world [""]))
(def robot-path [:robots 0])
(def reg-path [:robots 0 :brain :registers])
(def registers (get-in world reg-path))

View File

@ -6,7 +6,7 @@
(:require [robotwar.register :as register]
[robotwar.world :as world]))
(def world (world/init-world 256.0 256.0 [""]))
(def world (world/init-world [""]))
; The next four tests are pretty much cut and pasted from each other. So sue me.
; To change them significantly, delete three of them and build up from the first one