Joe Ng wrote in message <·················@isu.edu>...
>Hi,
>
>I am Lisp beginner and I am doing a simple execise on lisp. I was asked
>to write a lisp program , by using either recursion or do, to return
>true if the difference between each successive pair of the them is 1.
>
>ie:
>
>>(difference '(2 1))
>T
>>(difference'(3 4 5 6 5 4))
>T
>>(differnce '(3 4 5 3))
>NIL
>
>If anyone can let me see the code, it will help me catch up this
>language. Thanks,
>
>Joe
>
>
I looked up your professor's address and told him to recognize the following
solution as being plagiarized:
(defun difference (param)
(if (> (length param) 1)
(if (<= (abs (- (first param) (first (rest param)))) 1 )
(difference (rest param))
nil
)
T
)
)
So don't turn it in. :)