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. -- http://mail.python.org/mailman/listinfo/python-list