View Single Post
  #18  
Old 12-11-2010, 04:50 AM
fowlplay4 fowlplay4 is offline
team canada
fowlplay4's Avatar
Join Date: Jul 2004
Location: Canada
Posts: 5,200
fowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond reputefowlplay4 has a reputation beyond repute
Loop through the provided ingredients and compare them to the recipes actual ingredients.

Possible solutions:

PHP Code:
temp.matches countIngredients(recipe);
temp.match 0;
for (
ingredientingredients) {
  if (
ingredientInRecipe(recipeitemqty)) temp.match++;
}
if (
temp.match == temp.matches) {
  return 
recipe;

then in your.. ingredientInRecipe(recipe, item, qty) you can specify if it needs to be exact or what not.
__________________
Quote:
Reply With Quote