Skip to content

Instantly share code, notes, and snippets.

@thecoducer
Created August 17, 2017 17:58
Show Gist options
  • Save thecoducer/ea33a77deebf053e57357186b5cd27ed to your computer and use it in GitHub Desktop.
Save thecoducer/ea33a77deebf053e57357186b5cd27ed to your computer and use it in GitHub Desktop.
//take two variables x and y
//x is an integer and y is a float
x=50
y=29.3
//declare an array name, arr, with 3 elements
//first is a string, second is a function, third is a float
//because third is the sum of x and y, must be float
arr=<"I'm Mayukh", nimo[]{println "Hello"}, x+y>;
//running a loop
for[i=0;i<:arr.size[];i++]
{
//if any type is function
if[arr<i>.type[]=="function"]
println "I'm a function"
//if float then
elseif[arr<i>.type[]=="float"]
println "sum: "+arr<i>
else
println "string: "+arr<i>
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment