Created
September 22, 2023 07:27
-
-
Save highoncarbs/d4ad18d38192a192e04bbc94db1ab47a to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let formula = ""; | |
for root rules array : | |
formula = [ first ] [ operator ] [ if second_value_type == 'value' then [ second] else [ second (master )] ] | |
for (rule,index) in rules.rules: | |
let rule_level_one = [ rule.first ] [ rule.operator ] [ if rule.second_value_type == 'value' then [ rule.second] else [ rule.second (master )] ] // Will be truth or false | |
if rule_level_one: | |
for sub_rule in rule.rules: | |
let sub_rule_temp = [ sub_rule.first ] [ sub_rule.operator ] [ if sub_rule.second_value_type == 'value' then [ sub_rule.second] else [ sub_rule.second (master )] ] | |
formula = formula + sub_rule_temp |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment