mall-solver/main.py

23 lines
412 B
Python
Raw Permalink Normal View History

2023-11-23 01:11:19 -05:00
from typing import List
2023-11-23 18:14:39 -05:00
from data import Items, Recipes
from engine import Graph, World, solve
2023-11-23 01:11:19 -05:00
2023-11-23 18:14:39 -05:00
world = World(
bus=[
Items.IronBar,
Items.CopperBar,
Items.SteelBar,
],
items=Items.as_set(),
recipes=Recipes.as_set(),
size=10
)
2023-11-23 01:11:19 -05:00
2023-11-23 18:14:39 -05:00
solutions = solve(Graph.create_graph(world, Recipes.IronPlate))
2023-11-23 01:11:19 -05:00
2023-11-23 18:14:39 -05:00
if not solutions:
print("No solutions found")
exit(1)
2023-11-23 01:11:19 -05:00
for solution in solutions:
solution.draw()