19 lines
571 B
Plaintext
19 lines
571 B
Plaintext
module Chinese_zodiac {
|
|
yy= ("yang", "yin")
|
|
elements = ("Metal", "Water", "Wood", "Fire", "Earth")
|
|
animals = ("Rat", "Ox", "Tiger", "Rabbit", "Dragon", "Snake", "Horse", "Goat", "Monkey", "Rooster", "Dog", "Pig")
|
|
testThis = (1801, 1861, 1966, 1984, 2017, 2020, 2186, 76543)
|
|
i=each(testThis)
|
|
long yr, y, e, a
|
|
while i
|
|
yr = array(i)
|
|
y = yr mod 2
|
|
e = (yr div 2) mod 5
|
|
a = (yr - 4) mod 12
|
|
outstr = yr+" is the year of the "
|
|
outstr += elements#val$(e)+" " + animals#val$(a) + " (" + yy#val$(y) + ")."
|
|
print outstr
|
|
end while
|
|
}
|
|
Chinese_zodiac
|