Skip to content

Instantly share code, notes, and snippets.

@matejker
Last active August 30, 2021 22:05
Show Gist options
  • Save matejker/454e43d7be6d815903fbcfb6b4834833 to your computer and use it in GitHub Desktop.
Save matejker/454e43d7be6d815903fbcfb6b4834833 to your computer and use it in GitHub Desktop.
from tic_tac_toe.utils.permutations import get_all_boards
symmetry_classes, all_boards = get_all_boards(exclude_winners=False)
counts = [len(sc) for sc in symmetry_classes]
counts_all = [len(b) for b in all_boards]
print(f"Unique boards: {counts}, sum: {sum(counts)}")
print(f"All boards: {counts_all}, sum: {sum(counts_all)}")
symmetry_classes_menace, all_boards_menace = get_all_boards(exclude_winners=True)
counts_menace = [len(sc) for sc in symmetry_classes_menace]
counts_all_menace = [len(b) for b in all_boards_menace]
print(f"Unique boards: {counts_menace}, sum: {sum(counts_menace)}")
print(f"All boards: {counts_all_menace}, sum: {sum(counts_all_menace)}")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment