A crafting/recipe system is on the roadmap for my gamekit as one of the last minute big features before release and I've been trying to tackle ways of going about said crafting system.
Other than using some sort of array/database to store said recipes (and then checking for item-input results and/or if the inputted items match something is a whole other can of worms), one of my ideas to cover the output/item-input checking was to use a variable and append characters/numbers to for each new unique item and checking the result if it matches any of my specified stored recipes.
Numbers might work better if in the sense of item-IDs, and as a simple example:
Wood has an item-ID of 57 and Coal has an item-ID of 34. If variable-contents match 5734 or 3457 (allowing for both ways interchangeably, but it might get complex if there are more two items in a recipe, so lots of different results but that shouldn't be an issue here besides just more work), then remove items and output a few torches to the player's inventory and then clear the variable's contents afterwards.
Besides that specific example, anyone got any examples or suggestions of how I could go about handling a crafting system?