I'm trying to create a program that can calculate the required resources to get a specified amount of items per minute.
Here's an example of the json file
{
"id": "advanced-circuit",
"name": "Advanced circuit",
"type": "Intermediate product",
"wiki_link": "https://wiki.factorio.com/Advanced_circuit",
"category": "Intermediate product",
"recipe": {
"time": 6,
"yield": 1,
"ingredients": [
{
"id": "copper-cable",
"amount": 4
},
{
"id": "electronic-circuit",
"amount": 2
},
{
"id": "plastic-bar",
"amount": 2
}
]
}
},
{
"id": "arithmetic-combinator",
"name": "Arithmetic combinator",
"type": "Logic",
"wiki_link": "https://wiki.factorio.com/Arithmetic_combinator",
"category": "Logistics",
"recipe": {
"time": 0.5,
"yield": 1,
"ingredients": [
{
"id": "copper-cable",
"amount": 5
},
{
"id": "electronic-circuit",
"amount": 5
}
]
}
},
There are hundreds of different items. What I'm trying to do is have the user input the name of an item and return the recipe for that item. So if they say "Advanced circuit", it returns 4 copper cables, 2 electronic circuits, and 2 plastic bars, as well as the time it takes to craft the item and the yield. I've been googling this, but I'm not really getting anywhere. How would I do this?