Hi Monks,
As pointed out to me in Re^3: Turning foreach into map?, I should really be trying to learn refs instead of map just now.
I have been reading perlreftut, and started to get an idea for the first program I want to write to learn refs.
The program will simply ask for some food types and tell you if you can eat them together, according to a combination chart (This is taken from the, "You Are What You Eat Cookbook").
Following the example, I have a data format as follows (HoAs?) and I just want to check this is correct before moving on to the code:
%food_combining ---------------- proteins ---->| Cheese | Eggs | Fish | Game | Rabbit + | Meat | Milk | Nuts | Poultry | Shellfish | Soybeans | tofu | soya +| Yogurt carbohydrates ---->| oats | pasta | rice | rye | maize | m +illet | biscuits | bread | cakes | crackers | pastry | honey | maple +syrup | potatoes | yams | sweetcorn | sugar | sweets nonstarchy_veg_and_fats ---->| Butter | Cream | Herbs | Spices | Sea +sonings | Olive Oils | Oils | Salads | Seeds Fruit ---->| All Fruit
The rules, once someone enters something via <STDIN>, are:
Yes: Groups 1 and 3 Groups 2 and 3 Group 4 alone No: Groups 1 and 2 Groups 1 and 4 Groups 2 and 4 Groups 3 and 4
If so, I'll start writing.
Thanks.
For: | Use: | ||
& | & | ||
< | < | ||
> | > | ||
[ | [ | ||
] | ] |