Advertisement
Guest User

Untitled

a guest
Mar 30th, 2017
74
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.92 KB | None | 0 0
  1. (defn traverse [v, dimensions, x, y, current, counter]
  2. (cond
  3. ;;check to see if v is empty
  4. (empty? v)
  5. v
  6. ;;checking that x and y are less than or equal to the dimensions
  7. (and (<= x dimensions) (<= y dimensions))
  8. ;;assigning the value of x and y in v to current
  9. (assoc-in v [x y] current))
  10. ;; 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
  11.  
  12. ;;if x is less than the dimensions inc x
  13. (if (< x dimensions)
  14. (inc x))
  15. ;;if y is less than the dimensions and x is equal to dimensions inc y
  16. (if (and (< y dimensions) (= x dimensions))
  17. (traverse v dimensions 0 (inc y) current counter))
  18. ;;sasdasdasdasdsa
  19. (if (and (= y dimensions) (= x dimensions))
  20. (counter))
  21. ;;TO DO recur the function until the function is done
  22.  
  23. :else
  24. ;;once its done return the counter
  25. (counter)
  26. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement