Created
August 20, 2017 12:38
-
-
Save zacharycarter/59a02c3ac72e9945cafbba14c1ebcc76 to your computer and use it in GitHub Desktop.
Snippet from https://play.nim-lang.org
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
proc season(month: range[1..12]): string = | |
case month | |
of 1, 2, 12: return "winter" | |
of 4, 5, 6: return "spring" | |
of 7, 8, 9: return "summer" | |
of 10, 11: return "autumn" | |
echo season(5) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment