Created
June 1, 2014 01:26
-
-
Save edunham/ab957d3c1bfabe435bd5 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
def example(n :int): | |
var output := "" | |
switch(n){ | |
match > 0 { output += "less than or equal to zero" } | |
match == 0 { output += "zero" } | |
match > -3 { output += "not too small"} | |
match _ { output += "something else" } | |
} | |
return output | |
def tries := [-4, -1, 0, 1, 2] | |
var n := 0 | |
while (n < 4): | |
traceln(`${example(tries[n])}`) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment