Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions cubes.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def generate_polycubes(n, use_cache=False):
for new_cube in expand_cube(base_cube):
if not cube_exists_rle(new_cube, polycubes_rle):
polycubes.append(new_cube)
polycubes_rle.add(rle(new_cube))
for cube_rotation in all_rotations(new_cube):
polycubes_rle.add(rle(cube_rotation))

if (idx % 100 == 0):
perc = round((idx / len(base_cubes)) * 100,2)
Expand Down Expand Up @@ -200,9 +201,8 @@ def cube_exists_rle(polycube, polycubes_rle):
boolean: True if polycube is already present in the set of all cubes so far.

"""
for cube_rotation in all_rotations(polycube):
if rle(cube_rotation) in polycubes_rle:
return True
if rle(polycube) in polycubes_rle:
return True

return False

Expand Down