Question

I'm trying to design such a table in lua using love2d. While I read a lot of tutorials about Lua I couldn't manage to create such a table as I didn't understand the concept. can anyone help me in creating this table?

enter image description here

Was it helpful?

Solution

defining:

YourTable = {
  [1] = {Color1='Red',  Color2='Blue', Result='Yellow'},
  [2] = {Color1='Blue', Color2='Red',  Result='Orange'},
  [3] = ...
}

accessing:

print(YourTable[2].Color1)
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top