From 0a98ef930b25247f254fe56867e4b0326619f475 Mon Sep 17 00:00:00 2001 From: justuser31 Date: Sat, 4 May 2024 13:20:24 +0300 Subject: [PATCH] up --- reworked/calc.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/reworked/calc.py b/reworked/calc.py index 2b5f23b..5bfdbe4 100644 --- a/reworked/calc.py +++ b/reworked/calc.py @@ -8,7 +8,7 @@ def expand_recipe(recipe, recipes, main = False): part = 1 # Одна часть while not ok: ok = True - min_vol = 0 # Объём мин. рецепта (вход) + vol_in = 0 # Объём мин. рецепта (вход) # Перебираем элементы for el in recipe: # Если составное @@ -20,19 +20,19 @@ def expand_recipe(recipe, recipes, main = False): expanded = {} break else: - min_vol += expand_recipe(recipes[el].comps, recipes) + vol_in += expand_recipe(recipes[el].comps, recipes) else: if el in expanded: expanded[el] += recipe[el]*part else: expanded[el] = recipe[el]*part - min_vol += recipe[el]*part + vol_in += recipe[el]*part if main: - return expanded, min_vol, part + return expanded, vol_in, part else: - return min_vol + return vol_in def calc(element, amount, recipes): # Получаем характеристику элемента