I have a Lua table that is automatically generating X and Y values, I am trying to make it so that if an X value is the same as another X value in the table then it does something, the something right now is not important, the only answers I am finding is if you already know what is in in the table such as "orange" "blue" which is not of interest to me.
So let's say I have loads of number being generated into a table how do I check for a matched value in that table that gets generated maybe later on in the runtime. My x, y values are already rounded to 2 decimals ie: 1.10. And my x and y values are already being generated into a table.
My code
At the start time,
positiontableX = {}
positiontableY = {}
In the runtime,
newxpos = math.floor (a[1] * 100)/100
newypos = math.floor (a[2] * 100)/100
table.insert (positiontableX, 1, newxpos)
table.insert (positiontableY, 1, newypos)
In terms of the data that is being generated in the table that is another part of the code which I don't need to add here.