1 parent aade5ad commit bf3c4a5Copy full SHA for bf3c4a5
1 file changed
agents.py
@@ -524,6 +524,12 @@ def program(percept):
524
return action
525
return program
526
527
+def rule_match(state, rules):
528
+ "Find the first rule that matches state."
529
+ for rule in rules:
530
+ if rule.matches(state):
531
+ return rule
532
+
533
#______________________________________________________________________________
534
## The Wumpus World
535
0 commit comments