Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defn traverse [v, dimensions, x, y, current, counter]
- (cond
- ;;check to see if v is empty
- (empty? v)
- v
- ;;checking that x and y are less than or equal to the dimensions
- (and (<= x dimensions) (<= y dimensions))
- ;;assigning the value of x and y in v to current
- (assoc-in v [x y] current))
- ;; TO DO if current is equal to 1 call flood fill and pass in the the relevant stuff from the vector and inc the counter
- ;;if x is less than the dimensions inc x
- (if (< x dimensions)
- (inc x))
- ;;if y is less than the dimensions and x is equal to dimensions inc y
- (if (and (< y dimensions) (= x dimensions))
- (traverse v dimensions 0 (inc y) current counter))
- ;;sasdasdasdasdsa
- (if (and (= y dimensions) (= x dimensions))
- (counter))
- ;;TO DO recur the function until the function is done
- :else
- ;;once its done return the counter
- (counter)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement