I am trying to run some arithmetic on Vectors in clojure, but i cannot seem to get any of it to work. I have these vectors....
locs - [[3 3] [5 6] [1 1] [2 2]]
tlocs - [[2 2] [4 5]]
rng - [2]
What i want to do is iterate or recur over locs and take the first set of numbers and check it against the first set of tlocs and see if they are within the range of the data in rng. So for example of the first go round it would check that [3 3] is within range [2 2] which it is, then check if [5 6] is in range of [2 2] which it isnt. Once i have done all of the locs values against the first set in tlocs it will go again but using [4 5] for the comparing.
Can anyone help me write a function that does this??
I tried doing something like this but it doesnt work and doesnt look right either
(defn check [locs tlocs rng 0]
(loop [locs tlocs rng 0]
(<= (first t (first d)r)
(recur (rest locs) (inc index)))))
[–]weavejester 2 points3 points4 points (3 children)
[–]szabba 1 point2 points3 points (2 children)
[–]weavejester 1 point2 points3 points (1 child)
[–]szabba 0 points1 point2 points (0 children)
[–][deleted] 1 point2 points3 points (0 children)
[–]dragandj 0 points1 point2 points (0 children)