|
@@ -352,6 +352,14 @@ class State:
|
|
|
|
|
|
|
|
return cls.points, cls.fragmentation, cls.holes, cls.nmoves
|
|
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):
|
|
def print(self):
|
|
|
print_board(self.blocks, self.exa, self.held)
|
|
print_board(self.blocks, self.exa, self.held)
|
|
|
|
|
|
|
@@ -458,6 +466,14 @@ if __name__ == '__main__':
|
|
|
state.print()
|
|
state.print()
|
|
|
print()
|
|
print()
|
|
|
|
|
|
|
|
|
|
+ print('groups:')
|
|
|
|
|
+ state.print_groups()
|
|
|
|
|
+ print()
|
|
|
|
|
+
|
|
|
|
|
+ print('groupsizes:')
|
|
|
|
|
+ state.print_groupsizes()
|
|
|
|
|
+ print()
|
|
|
|
|
+
|
|
|
start = time.time()
|
|
start = time.time()
|
|
|
newstate = state.solve()
|
|
newstate = state.solve()
|
|
|
end = time.time()
|
|
end = time.time()
|