Den Fri, 02 Mar 2007 16:46:05 -0800 skrev Paul Rubin: > Thomas Dybdahl Ahle <[EMAIL PROTECTED]> writes: >> Do you mean that I add my moves something like this? >> >> from heapq import heappush, heappop >> heap = [] >> for move in genAll(): >> heappush(heap, (-getMoveValue (board, table, ply, move), move)) >> >> And then use heappop(heap) in the alphabeta loop? > > Yes, something like that. If you want to get, say, the five smallest > values in a list, heapq lets you do that without having to sort the > whole list.
Yeah, I use this now. The only think I don't really like, is the need of creating a ton of tupples, but it doesn't show me too much it seams. -- http://mail.python.org/mailman/listinfo/python-list