Skip to content

Instantly share code, notes, and snippets.

@edunham
Created June 1, 2014 01:26
Show Gist options
  • Save edunham/ab957d3c1bfabe435bd5 to your computer and use it in GitHub Desktop.
Save edunham/ab957d3c1bfabe435bd5 to your computer and use it in GitHub Desktop.
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