Chinese zodiac: Difference between revisions
Content added Content deleted
(Added Easylang) |
|||
Line 1,493: | Line 1,493: | ||
1985 is the year of the Wood Ox (yin). 乙丑 |
1985 is the year of the Wood Ox (yin). 乙丑 |
||
2017 is the year of the Fire Rooster (yin). 丁酉</pre> |
2017 is the year of the Fire Rooster (yin). 丁酉</pre> |
||
=={{header|EasyLang}}== |
|||
<syntaxhighlight> |
|||
animal$[] = [ "Rat" "Ox" "Tiger" "Rabbit" "Dragon" "Snake" "Horse" "Goat" "Monkey" "Rooster" "Dog" "Pig" ] |
|||
element$[] = [ "Wood" "Fire" "Earth" "Metal" "Water" ] |
|||
yingyang$[] = [ "Yang" "Yin" ] |
|||
animal_ch$[] = strchars "子丑寅卯辰巳午未申酉戌亥" |
|||
stem_ch$[] = strchars "甲乙丙丁戊己庚辛壬癸" |
|||
# |
|||
proc get year . el$ an$ yy$ anch$ stch$ . |
|||
idx = (year - 4) mod 10 |
|||
el$ = element$[idx div 2 + 1] |
|||
stch$ = stem_ch$[idx + 1] |
|||
idx = (year - 4) mod 12 |
|||
an$ = animal$[idx + 1] |
|||
anch$ = animal_ch$[idx + 1] |
|||
yy$ = yingyang$[year mod 2 + 1] |
|||
. |
|||
proc zodiac year . . |
|||
get year el$ an$ yy$ anch$ stch$ |
|||
print year |
|||
cycle = (year - 1983) mod1 60 |
|||
print " " & el$ & " " & an$ & " " & yy$ & " " & cycle & "/60" |
|||
print " " & stch$ & anch$ |
|||
print "" |
|||
. |
|||
zodiac 1935 |
|||
zodiac 1938 |
|||
zodiac 1968 |
|||
zodiac 1972 |
|||
zodiac 1976 |
|||
zodiac 1984 |
|||
zodiac 2017 |
|||
</syntaxhighlight> |
|||
=={{header|Excel}}== |
=={{header|Excel}}== |
||
===LAMBDA=== |
===LAMBDA=== |
||
Line 1,897: | Line 1,932: | ||
| style="text-align:center" | bright |
| style="text-align:center" | bright |
||
|} |
|} |
||
=={{header|F Sharp|F#}}== |
=={{header|F Sharp|F#}}== |
||
<syntaxhighlight lang="fsharp"> |
<syntaxhighlight lang="fsharp"> |