Skip to content

Instantly share code, notes, and snippets.

@xnuk
Last active August 29, 2015 14:02
Show Gist options
  • Select an option

  • Save xnuk/f24d4b46d640b859addd to your computer and use it in GitHub Desktop.

Select an option

Save xnuk/f24d4b46d640b859addd to your computer and use it in GitHub Desktop.
//specific type
int funca int a, char, string b [
int d = a + b.length + \1 // char \1
return d
]
//non-specific type
funcb a, var, c [
var d = a + c.length,c + \1 // var \1
// -> if c.length is null then use c
return d
]
//launch function
funca 1, 'a', 'abcd' //returns 0x5a
funca 3, "b", "vfcdd" //returns 0x8b
funca 3, "bf", "vfcdd" //returns 0x8b ("bf" as char -> "b")
funca 3, "v", "vfcdd" //throws cast error
funcb 1, 'a', 'abcd' //returns "5a"
funcb 3, "b", "vfcdd" //returns "8b"
funcb 3, "bf", "vfcdd" //returns "8bf"
funcb 3, "v", "vfcdd" //returns "8v"
for 1 [int i] 10 skip 4 [i] 7 [
console.log i //would log when i == 1, 2, 3, 8, 9, 10
].extract[i, [
console.log i //would be 11
]
]
console.log i //would be undefined
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment