Isoraqathedh

cny-given

Feb 7th, 2014
177
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lisp 0.77 KB | None | 0 0
  1. (defun chinese-new-years-given (zodiac-animal affilated-element) ; Read the function name with the argument list
  2.   (loop
  3.        for i from 0 to  (length *chinese-new-years*)
  4.        if (and (= (mod (1- i) (length *chinese-zodiac-names*))(position zodiac-animal *chinese-zodiac-names*))
  5.            (= (mod (1- i) (length *chinese-elements*))    (position affilated-element *chinese-elements*)))
  6.        collect (list (nth i *chinese-new-years*) (next i *chinese-new-years*))
  7.   ; {[chineseNewYears[i], next(chineseNewYears[i]) for i in range(len(chineseNewYears)) if ((i - 1) mod len(czn) == za and ((i - 1) mod len(ce) == ae))}
  8.   ))
  9.  
  10. (defun next (i list)
  11.   (cond
  12.     ((> i (length list)) NIL)
  13.     ((< i 1) NIL)
  14.     ((= i (length list)) (first list))
  15.     (t (nth (1+ i) list))))
Advertisement
Add Comment
Please, Sign In to add comment