Skip to content

Instantly share code, notes, and snippets.

@mathewmariani
Created February 14, 2018 00:52
Show Gist options
  • Save mathewmariani/feb9c3c030bb0bc9939a1635ae7ce4a0 to your computer and use it in GitHub Desktop.
Save mathewmariani/feb9c3c030bb0bc9939a1635ae7ce4a0 to your computer and use it in GitHub Desktop.
class Foo {
constructor() {
print("Foo has been constructed\n")
}
</ min = 0, max = 5 />
function test(i) {
local min = Foo.getattributes("test").min
local max = Foo.getattributes("test").max
return i < min ? min : (i > max ? max : i)
}
}
local f = Foo()
for (local i = -2; i < 8; i++) {
print(f.test(i)+"\n")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment