separated source programs out into regular and dev

This commit is contained in:
Richard Harrington 2013-08-24 06:37:49 -04:00
parent 07bb7db5c9
commit d03d64bd6a
3 changed files with 145 additions and 126 deletions

View File

@ -12,7 +12,7 @@
(def progs
(repeat 3 (:mover source-programs/programs)))
(repeat 3 (:mover source-programs/dev-programs)))
(def world
(world/init-world progs))
(defn combined-worlds []

View File

@ -1,37 +1,12 @@
(ns robotwar.source-programs)
(def programs
{:multi-use
" START
0 TO A
TEST
IF A > 2 GOTO START
GOSUB INCREMENT
GOTO TEST
100 TO A
INCREMENT
A + 1 TO A
ENDSUB
200 TO A "
:index-data
; to test the INDEX/DATA pair of registers
" 300 TO A
1 TO INDEX
DATA TO B"
:random
; to test the RANDOM register
" 1000 TO RANDOM
RANDOM TO A
RANDOM TO A
RANDOM TO A
RANDOM TO A
RANDOM TO A "
{
:speedy
" 140 TO SPEEDX
250 TO SPEEDY "
"
140 TO SPEEDX
250 TO SPEEDY
"
:mover
"
@ -65,7 +40,8 @@
MOVEY
B - Y TO SPEEDY ; Take distance from destination in meters and use
; it to set SPEEDY, which is measured in decimeters/second.
ENDSUB "
ENDSUB
"
:left-shooter
"
@ -95,7 +71,8 @@
SHOOT
200 TO SHOT
GOTO MOVE "
GOTO MOVE
"
:top-shooter
"
@ -125,7 +102,8 @@
SHOOT
200 TO SHOT
GOTO MOVE "
GOTO MOVE
"
:shooter
"
@ -133,5 +111,46 @@
200 - Y TO S
SHOOT
S TO SHOT
GOTO SHOOT "
})
GOTO SHOOT
"
})
(def dev-programs
(merge
programs
{
:multi-use
"
START
0 TO A
TEST
IF A > 2 GOTO START
GOSUB INCREMENT
GOTO TEST
100 TO A
INCREMENT
A + 1 TO A
ENDSUB
200 TO A
"
:index-data
; to test the INDEX/DATA pair of registers
"
300 TO A
1 TO INDEX
DATA TO B
"
:random
; to test the RANDOM register
"
1000 TO RANDOM
RANDOM TO A
RANDOM TO A
RANDOM TO A
RANDOM TO A
RANDOM TO A
"
}))

View File

@ -7,7 +7,7 @@
[robotwar.source-programs :as source-programs]))
(def initial-world
(world/init-world [(:multi-use source-programs/programs)]))
(world/init-world [(:multi-use source-programs/dev-programs)]))
(def combined-worlds (world/build-combined-worlds initial-world))