Using the table posted below I would like to find every dictionary key with a specific value ranging from 0 to 1 (A to D) and ignore the rest (E to H). Can anyone give me advice as to how I can approach this?
ExampleTable = { ["A"] = 0, ["B"] = 0, ["C"] = 1, ["D"] = 1, ["E"] = 2, ["F"] = 2, ["G"] = 3, ["H"] = 3, }
With the example provided, something like this should work:
for i,v in pairs(ExampleTable) do if i == "A" or i == "B" or i == "C" or i == "D" then -- Checking if the key is A to D print(v) -- Printing the value end end