Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (defparameter *chinese-new-years*
- '((1924 2 5) (1925 1 24) (1926 2 13) (1927 2 2) (1928 1 22) (1929 2 9)
- (1930 1 29) (1931 2 17) (1932 2 6) (1933 1 25) (1934 2 14) (1935 2 3)
- (1936 1 24) (1937 2 11) (1938 1 31) (1939 2 19) (1940 2 8) (1941 1 27)
- (1942 2 15) (1943 2 5) (1944 1 25) (1945 2 13) (1946 2 2) (1947 1 22)
- (1948 2 10) (1949 1 29) (1950 2 17) (1951 2 6) (1952 1 27) (1953 2 14)
- (1954 2 3) (1955 1 24) (1956 2 12) (1957 1 30) (1958 2 18) (1959 2 8)
- (1960 1 28) (1961 2 15) (1962 2 5) (1963 1 25) (1964 2 13) (1965 2 2)
- (1966 1 21) (1967 2 9) (1968 1 30) (1969 2 17) (1970 2 6) (1971 1 27)
- (1972 2 15) (1973 2 3) (1974 1 23) (1975 2 11) (1976 1 31) (1977 2 18)
- (1978 2 7) (1979 1 28) (1980 2 16) (1981 2 5) (1982 1 25) (1983 2 13)
- (1984 2 2) (1985 2 20) (1986 2 9) (1987 1 29) (1988 2 17) (1989 2 6)
- (1990 1 27) (1991 2 14) (1992 2 4) (1993 1 23) (1994 2 10) (1995 1 31)
- (1996 2 19) (1997 2 7) (1998 1 28) (1999 2 16) (2000 2 5) (2001 1 24)
- (2002 2 12) (2003 2 1) (2004 1 22) (2005 2 9) (2006 1 29) (2007 2 18)
- (2008 2 7) (2009 1 26) (2010 2 14) (2011 2 3) (2012 1 23) (2013 2 10)
- (2014 1 31) (2015 2 19) (2016 2 8) (2017 1 28) (2018 2 16) (2019 2 5)
- (2020 1 25) (2021 2 12) (2022 2 1) (2023 1 22) (2024 2 10) (2025 1 29)
- (2026 2 17) (2027 2 6) (2028 1 26) (2029 2 13) (2030 2 3) (2031 1 23)
- (2032 2 11) (2033 1 31) (2034 2 19) (2035 2 8) (2036 1 28) (2037 2 15)
- (2038 2 4) (2039 1 24) (2040 2 12) (2041 2 1) (2042 1 22) (2043 2 10))
- "list of Chinese new years from 1924 to 2043 (two sexagenary cycles)")
- ;
- (defparameter *chinese-zodiac-names*
- '("rat" "ox" "tiger" "rabbit" "dragon" "snake" "horse" "goat" "monkey" "rooster" "dog" "pig")
- "List of Chinese zodiac animals, lines up with the above list , i.e. 1924 is RAT, 1925 is OX, etc.")
- (defparameter *chinese-elements* '("metal" "wood" "water" "fire" "earth")
- "List of Chinese animals, lines up with the above list, (rat 1924) is METAL etc.")
- (defparameter *western-zodiac-month-boundaries*
- '((3 21 "aries") (4 21 "taurus") (5 22 "gemini")
- (6 22 "cancer") (7 23 "leo") (8 23 "virgo")
- (9 23 "libra") (10 23 "scorpio") (11 23 "sagittarius")
- (12 22 "capricorn") (1 21 "aquarius") (2 20 "pisces")))
- ;
- (defparameter *western-zodiac-names*
- '("aries" "taurus" "gemini" "cancer" "leo" "virgo" "libra" "scorpio" "sagittarius" "capricorn" "aquarius" "pisces"))
- ;
- (defun combine-dates (year-interval month-start)
- (list (first year-interval) (first month-start) (second month-start)))
- (defun next (i list)
- (cond
- ((> i (length list)) NIL)
- ((< i 1) NIL)
- ((= i (length list)) (first list))
- (t (nth (1+ i) list))))
- (defun chinese-new-years-given (zodiac-animal affilated-element) ;Read with the argument list
- (loop
- for i from 0 below (length *chinese-new-years*)
- if (and (= (mod i (length *chinese-zodiac-names*))(position zodiac-animal *chinese-zodiac-names*))
- (= (mod 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 mod len(czn) == za and ((i mod len(ce) == ae))}
- ))
Advertisement
Add Comment
Please, Sign In to add comment