From cfc3b5b7caded63085c39763b16a82e30cae1d98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20H=C3=A4fliger?= Date: Fri, 2 May 2025 15:16:16 +0200 Subject: [PATCH] no message --- Verbraucher_extern/module.php | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/Verbraucher_extern/module.php b/Verbraucher_extern/module.php index 8c7eaf1..31172b9 100644 --- a/Verbraucher_extern/module.php +++ b/Verbraucher_extern/module.php @@ -87,22 +87,23 @@ class Verbraucher_extern extends IPSModule return array_values(array_unique($kombinationen)); } + private function findCombinationRecursive($power, $values, $currentCombination, $startIndex, &$result) { + if ($power == 0) { + $result = $currentCombination; + return true; + } + if ($power < 0) { + return false; + } + } private function findCombination($power, $values) { $result = []; - $found = findCombinationRecursive($power, $values, [], 0, $result); + $found = $this->findCombinationRecursive($power, $values, [], 0, $result); return $found ? $result : null; } - private function findCombinationRecursive($power, $values, $currentCombination, $startIndex, &$result) { - if ($power == 0) { - $result = $currentCombination; - return true; - } - if ($power < 0) { - return false; - } - } + private function find($target, $values, $current, &$result) { if ($target == 0) { $result[] = $current;