mirror of
https://github.com/richardharrington/robotwar.git
synced 2024-05-31 11:41:29 +00:00
added list of commands data structure, for parser
This commit is contained in:
parent
1d703dd693
commit
cd7a707b6a
|
@ -1,13 +1,16 @@
|
|||
(ns hs-robotwar.core)
|
||||
|
||||
(use '[clojure.core.match :only (match)])
|
||||
(use '[clojure.set :only (union)])
|
||||
|
||||
|
||||
(def registers (set (concat (map #(-> % char str) (range (int \A) (inc (int \Z))))
|
||||
["AIM" "SHOT" "RADAR" "DAMAGE" "SPEEDX" "SPEEDY" "RANDOM" "INDEX"])))
|
||||
|
||||
(def operators #{\= \< \> \# \+ \- \* \/})
|
||||
|
||||
(def registers (union (set (map #(-> % char str) (range (int \A) (inc (int \Z)))))
|
||||
#{"AIM" "SHOT" "RADAR" "DAMAGE" "SPEEDX" "SPEEDY" "RANDOM" "INDEX"}))
|
||||
|
||||
(def commands (union (set (map str operators))
|
||||
#{"TO" "IF" "GOTO" "GOSUB" "ENDSUB"}))
|
||||
|
||||
(defn conj-with-metadata
|
||||
[coll s n]
|
||||
|
|
Loading…
Reference in New Issue
Block a user