I wrote my favorite function ever last semester with itertools! It (roughly) lazily generates a list of dictionaries that map players to their moves for all possible moves. It turns out you can do that with a chain of combinations, two cartesian products, and an imap: https://github.com/shargoj/acquire/blob/master/gametree.py#L...
No comments yet.