Posted 06 January 2013 - 10:49 AM
[left]Hi, I'm pretty new to Lua but thanks to the vast wealth of tutorials available on the net, I'm learning fairly fast.
However I've currently got a problem, and this time google hasn't provided me with any answers, so hopefully someone here will be able to help.
I understand how to solve my problem from a maths point of view so hopefully the coding will be similar.
I have two variables: x and y, and a set/table z, where z={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} and x∈z.
I want to create an 'if' function along the lines of:
If y∈{{z}\x}, then …
In other words, if y equals any element of the table/set z, excluding x, then the condition is true, otherwise it is false.
An ideas how to translate this into Lua code?
Thanks.[/left]
However I've currently got a problem, and this time google hasn't provided me with any answers, so hopefully someone here will be able to help.
I understand how to solve my problem from a maths point of view so hopefully the coding will be similar.
I have two variables: x and y, and a set/table z, where z={1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16} and x∈z.
I want to create an 'if' function along the lines of:
If y∈{{z}\x}, then …
In other words, if y equals any element of the table/set z, excluding x, then the condition is true, otherwise it is false.
An ideas how to translate this into Lua code?
Thanks.[/left]