Omnimaga

Calculator Community => TI Calculators => Lua => Topic started by: TheNlightenedOne on March 28, 2013, 11:07:10 am

Title: Find nth element in a set?
Post by: TheNlightenedOne on March 28, 2013, 11:07:10 am
I'm using math.eval to generate a set. How do I find the nth element of that set from Lua?
Title: Re: Find nth element in a set?
Post by: Adriweb on March 28, 2013, 11:17:23 am
I'm not sure what you mean, but simply calling it the normal way would work ?

myTable[n] ?

(works in Basic and in Lua, but if done in Lua, it would require you to have var.recall()ed it first, of course...)
Title: Re: Re: Find nth element in a set?
Post by: TheNlightenedOne on March 28, 2013, 12:21:28 pm
Can I use that to randomize the order of the elements?

EDIT: nevermind, I realized I can pass a math.eval into a table as an argument. Thanks adriweb