2
votes

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

1

1 Answers

6
votes

defining:

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

accessing:

print(YourTable[2].Color1)