Commit 5d8c67cd authored by Taddeüs Kroes's avatar Taddeüs Kroes

Print groups in debug output

parent 48a6ae87
......@@ -352,6 +352,14 @@ class State:
return cls.points, cls.fragmentation, cls.holes, cls.nmoves
def print_groupsizes(self):
for start in range(len(self.groupsizes) - COLUMNS, -1, -COLUMNS):
print(' '.join('%-2d' % g for g in self.groupsizes[start:start + COLUMNS]))
def print_groups(self):
for start in range(len(self.groups) - COLUMNS, -1, -COLUMNS):
print(' '.join('%-2d' % g for g in self.groups[start:start + COLUMNS]))
def print(self):
print_board(self.blocks, self.exa, self.held)
......@@ -458,6 +466,14 @@ if __name__ == '__main__':
state.print()
print()
print('groups:')
state.print_groups()
print()
print('groupsizes:')
state.print_groupsizes()
print()
start = time.time()
newstate = state.solve()
end = time.time()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment