- Log in to post comments
馃嵕馃帀馃敟
Well done!
@Evgeny Shvarov Evgeny, please add points to Health Harbout team for IPM also.
Hello @Evgeny Shvarov ! I comleted IRIS For Health Instruqt Survey. Please add points to Health Harbout team for this criteria
馃憦馃憦馃憦
Test yourself: InterSystems testing platform
Thanks for this useful article!
Class codeGolf.ChineseZodiac
{
ClassMethod Calendar(y As%Integer) As%String
{
Set startYear = 1924Set animals = "Rat,Ox,Tiger,Rabbit,Dragon,Snake,Horse,Goat,Monkey,Rooster,Dog,Pig"Set elements = "Wood,Fire,Earth,Metal,Water"Set diff = y - startYear
If diff < 0Quit"Invalid Year"Set animalIndex = (diff + 12) % 12Set elementIndex = (diff / 2) % 5Set animal = $List(animals, animalIndex + 1)
Set element = $List(elements, elementIndex + 1)
Quit element_" "_animal
}
}Well done, guys! Congrats 馃帀
Useful guidelines! Thanks!