Advertisement
Guest User

Untitled

a guest
Dec 7th, 2019
154
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.34 KB | None | 0 0
  1. (defun distanta(ar father_stack dist nod)
  2.     (cond
  3.         ((eq (car ar) nod) dist)
  4.         ((= (car (cdr ar)) 2)(distanta (cdr (cdr ar)) (cons (+ dist 1) father_stack) (+ dist 1) nod))
  5.         ((= (car (cdr ar)) 1)(distanta (cdr (cdr ar)) father_stack (+ dist 1) nod))
  6.         ((= (car (cdr ar)) 0)(distanta (cdr (cdr ar)) (cdr father_stack) (car father_stack) nod))
  7.     )
  8. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement