Domanda

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

È stato utile?

Soluzione

defining:

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

accessing:

print(YourTable[2].Color1)
Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top