Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit bf3c4a5

Browse files
committed
Added a definition of rule_match().
1 parent aade5ad commit bf3c4a5

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

agents.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -524,6 +524,12 @@ def program(percept):
524524
return action
525525
return program
526526

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+
527533
#______________________________________________________________________________
528534
## The Wumpus World
529535

0 commit comments

Comments
 (0)