Hey all,
I’m creating a “Tea/Benefits Chart” that allows the user to search for a type of tea and find out what problems it can cure, or search for a problem and find out what types of tea assist with it. For this I’ve created 2 arrays - arrTea and arrBenefits - to store a list of the possible types of tea and benefits a user can find.
Code:
var arrTea:Array = Array("lemongrass", "chamomile");
var arrBenefits:Array = Array("anxiety", "cramps", "indigestion", "PMS");
For example, if the user searched for “chamomile” the Chart might return “anxiety” and “indigestion”. If they searched for “cramps” the Chart returns “lemongrass”.
I need a way to keep track of which teas go with which benefits and vice versa. Would this be a situation to use associative arrays? I’d appreciate any guidance on this.
Thanks a lot!