Advertisement
Guest User

Untitled

a guest
Mar 12th, 2016
222
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.51 KB | None | 0 0
  1. (defvar *n*)
  2. (setf *n* 100)
  3.  
  4. (defvar *m*)
  5. (setf *m* 100)
  6.  
  7. (defvar *x1*)
  8. (setf *x1* 60)
  9.  
  10. (defvar *y1*)
  11. (setf *y1* 60)
  12.  
  13. (defvar *k*)
  14. (setf *k* 200)
  15.  
  16. (defun step (x y k)
  17. (if (= k 0)
  18. (if (and (= x *x1*) (= y *y1*)) 1 0)
  19.  
  20.  
  21. (let (
  22. (up (if (< (+ y 1) *m*) (step (x) (+ y 1) (- k 1)) 0))
  23. (down (if (>= (- y 1) 0) (step (x) (- y 1) (- k 1)) 0))
  24. (left (if (< (+ x 1) *n*) (step (+ x 1) (y) (- k 1)) 0))
  25. (right (if (>= (- x 1) 0) (step (- x 1) (y) (- k 1)) 0)))
  26. (+ up down left right))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement