Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defun chinese-new-years-given (zodiac-animal affilated-element) ; Read the function name with the argument list
- (loop
- for i from 0 to (length *chinese-new-years*)
- if (and (= (mod (1- i) (length *chinese-zodiac-names*))(position zodiac-animal *chinese-zodiac-names*))
- (= (mod (1- i) (length *chinese-elements*)) (position affilated-element *chinese-elements*)))
- collect (list (nth i *chinese-new-years*) (next i *chinese-new-years*))
- ; {[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))}
- ))
- (defun next (i list)
- (cond
- ((> i (length list)) NIL)
- ((< i 1) NIL)
- ((= i (length list)) (first list))
- (t (nth (1+ i) list))))
Advertisement
Add Comment
Please, Sign In to add comment