Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defvar *n*)
- (setf *n* 100)
- (defvar *m*)
- (setf *m* 100)
- (defvar *x1*)
- (setf *x1* 60)
- (defvar *y1*)
- (setf *y1* 60)
- (defvar *k*)
- (setf *k* 200)
- (defun step (x y k)
- (if (= k 0)
- (if (and (= x *x1*) (= y *y1*)) 1 0)
- (let (
- (up (if (< (+ y 1) *m*) (step (x) (+ y 1) (- k 1)) 0))
- (down (if (>= (- y 1) 0) (step (x) (- y 1) (- k 1)) 0))
- (left (if (< (+ x 1) *n*) (step (+ x 1) (y) (- k 1)) 0))
- (right (if (>= (- x 1) 0) (step (- x 1) (y) (- k 1)) 0)))
- (+ up down left right))))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement