Python TJ-Wriggle puzzle solver