Chinese zodiac: Difference between revisions

Content deleted Content added
PureFox (talk | contribs)
→‎{{header|Wren}}: Library name change.
Thebigh (talk | contribs)
add FreeBASIC
Line 913: Line 913:
2017 is the year of the Fire Rooster (yin).
2017 is the year of the Fire Rooster (yin).
</pre>
</pre>

=={{header|FreeBASIC==}}
<lang freebasic>dim as string yy(0 to 1) = {"yang", "yin"}
dim as string elements(0 to 4) = {"Wood", "Fire", "Earth", "Metal", "Water"}
dim as string animals(0 to 11) = {"Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake",_
"Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig"}

dim as uinteger yr, y, e, a, i, tests(0 to 5) = {1801, 1861, 1984, 2020, 2186, 76543}
dim as string outstr

for i = 0 to 5
yr = tests(i)
y = yr mod 2
e = (yr - 4) mod 5
a = (yr - 4) mod 12
outstr = str(yr)+" is the year of the "
outstr += elements(e)+" " + animals(a) + " (" + yy(y) + ")."
print outstr
next i</lang>
{{out}}
<pre>
1801 is the year of the Earth Rooster (yin).
1861 is the year of the Earth Rooster (yin).
1984 is the year of the Wood Rat (yang).
2020 is the year of the Fire Rat (yang).
2186 is the year of the Earth Dog (yang).
76543 is the year of the Water Rabbit (yin).</pre>


=={{header|Go}}==
=={{header|Go}}==