I am trying to understand the first premise in pyke.
Assume I have various shapes of various colors-
source.source_value(circle,red)
source.source_value(circle,green)
source.source_value(circle,blue)
and I also have a preference as blue,green,red.
If there's a shape in blue I'll keep it, else will search for green else finally red.
I have the following rule:
select_shape_colors
foreach
source.source_value($shape,$color)
$color_preference = get_color_preference()
forall $color in color_preference
first
source.source_value($shape2,$color2)
assert
source.final_shape_color($shape2,$color2)
fc_extras
def get_color_preference():
return ('blue','green','red')
however the rule fails due to syntax and logical errors. Does anyone have any idea what I'm doing wrong?
Thanks