Help with AI search script

Frank Buss fb at frank-buss.de
Tue Aug 27 22:40:48 EDT 2002


denimboy at yahoo.com (Dennis Watson) wrote:

> def depth_first (start, goal_p, successors):
>     """Search new states first until goal is reached"""
>     return tree_search ( [start], goal_p, successors, lambda (new,
> old): (new.extend(old)) )

You MUST write:

lambda new, old: (new.extend(old))

And you CAN omit the other parantheses:

lambda new, old: new.extend(old)

For all lambda expressions in your code.

-- 
Frank Buss, fb at frank-buss.de
http://www.frank-buss.de, http://www.it4-systems.de

[ comp.ai is moderated.  To submit, just post and be patient, or if ]
[ that fails mail your article to <comp-ai at moderators.isc.org>, and ]
[ ask your news administrator to fix the problems with your system. ]



More information about the Python-list mailing list