Hello guys,
I have one table.
local color = { {key=“red”}, {key=“blue”}, {key=“green”}, {key=“white”} }
How to choose TWO random items from color table, but not the same one (like not to choose two red items)?
Thanks 
Ivan
Hello guys,
I have one table.
local color = { {key=“red”}, {key=“blue”}, {key=“green”}, {key=“white”} }
How to choose TWO random items from color table, but not the same one (like not to choose two red items)?
Thanks 
Ivan
One way you can achieve this would be to set your chooser up to be the first and second in the table. Then shuffle the table as often as you need to in order to change what the first 2 colors are.
From what I can tell:
create objects
setup a table of colors
function to shuffle the table
function to change the objects color based on the table.
Hope this is helpful,
Here’s a tutorial on this: https://coronalabs.com/blog/2014/09/30/tutorial-how-to-shuffle-table-items/
Rob
Great guys!
Thanks!
Ivan
One way you can achieve this would be to set your chooser up to be the first and second in the table. Then shuffle the table as often as you need to in order to change what the first 2 colors are.
From what I can tell:
create objects
setup a table of colors
function to shuffle the table
function to change the objects color based on the table.
Hope this is helpful,
Here’s a tutorial on this: https://coronalabs.com/blog/2014/09/30/tutorial-how-to-shuffle-table-items/
Rob
Great guys!
Thanks!
Ivan