by lqet · 1y ago · 0 comments
Just out of curiosity, why do you find the code horrid? There are really only 9 lines of code that aren't glue code, and apart from the error prints (which are really irrelevant for these demonstration purposes), the code looks basically fine to me.
EDIT:
seen = []
for b in boards:
if set(seen).isdisjoint(orbit(b)):
seen.append(b)
Ah, well...EDIT 2: also, see comment below, it's not Python
I didn't realize it was Sage (I didn't know that existed) but I'm not sure that actually makes a difference. Obviously it works, and that's fine, but it's still horribly ugly.