Chinese zodiac: Difference between revisions

Chinese zodiac en Yabasic
(Chinese zodiac en Yabasic)
Line 3,977:
2020 庚子 gēng-zĭ Metal Rat Yang 37/60
</pre>
 
 
=={{header|Yabasic}}==
<lang Yabasic>
dim Animals$(12) : for a = 0 to 11 : read Animals$(a) : next a
dim Elements$(5) : for a = 0 to 4 : read Elements$(a): next a
dim YinYang$(2) : for a = 0 to 1 : read YinYang$(a) : next a
dim Years(7) : for a = 0 to 6 : read Years(a) : next a
 
for i = 0 to arraysize(Years(),1)-1
xYear = Years(i)
yElement$ = Elements$((Mod((xYear - 4), 10)) / 2)
yAnimal$ = Animals$( Mod((xYear - 4), 12))
yYinYang$ = YinYang$( Mod(xYear, 2) )
nn = ( Mod((xYear - 4), 60)) + 1
print xYear, " is the year of the ", yElement$, " ", yAnimal$, " (", yYinYang$, ")."
next i
print
end
 
data "Rat","Ox","Tiger","Rabbit","Dragon","Snake","Horse","Goat","Monkey","Rooster","Dog","Pig"
data "Wood","Fire","Earth","Metal","Water"
data "Yang","Yin"
data 1935, 1938, 1968, 1972, 1976, 1984, 2017
</lang>
{{out}}
<pre>
1935 is the year of the Wood Pig (Yin).
1938 is the year of the Earth Tiger (Yang).
1968 is the year of the Earth Monkey (Yang).
1972 is the year of the Water Rat (Yang).
1976 is the year of the Fire Dragon (Yang).
1984 is the year of the Wood Rat (Yang).
2017 is the year of the Fire Rooster (Yin).
</pre>
 
 
=={{header|zkl}}==
2,134

edits