mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-10-03 03:55:43 +00:00
got core, exec, create, lexicon namespaces going
This commit is contained in:
parent
4ce2f3a61b
commit
438b2382c9
@ -1,4 +1,5 @@
|
||||
(ns rw.core
|
||||
(ns rw.create
|
||||
(:refer-clojure :exclude [compile])
|
||||
(:use [clojure.string :only [split join]]
|
||||
[rw.lexicon :only [registers op-commands commands]]))
|
||||
|
||||
|
@ -1,11 +1,12 @@
|
||||
(ns rw.core
|
||||
(ns rw.exec
|
||||
(:require (rw [lexicon :as lexicon])))
|
||||
|
||||
(def op-map (zipmap lexicon/op-commands
|
||||
(map #(case %
|
||||
"/" #(int (Math/round (float (/ %1 %2))))
|
||||
"#" not=
|
||||
(read-string %))
|
||||
(map (fn [op]
|
||||
(case op
|
||||
"/" #(int (Math/round (float (/ %1 %2))))
|
||||
"#" not=
|
||||
(read-string op)))
|
||||
lexicon/op-commands)))
|
||||
|
||||
(defn resolve-register [registers reg]
|
@ -9,7 +9,7 @@
|
||||
|
||||
(def commands (concat op-commands word-commands))
|
||||
|
||||
(def get-register-by-idx
|
||||
(defn get-register-by-idx
|
||||
"to allow use of the INDEX/DATA register pair, we need to have a way of
|
||||
getting registers by their index, but starting from 1, not 0."
|
||||
[idx]
|
||||
|
Loading…
Reference in New Issue
Block a user