def test_generate(self): b = pentominoes.Board() p = pentominoes.make_piece('i') for i in pentominoes.orientations(p): print '=' * 33 print i
def spin(size=5): ''' generate 3-space coordes for every orientation of a piece ''' ypiece = pentominoes.make_piece('y') for o in pentominoes.orientations(ypiece): for p in pentominoes.piece_placements(o, size, size): for plane in range(size): three_d = translate_to_plane(p, zplane=plane) yield three_d for plane in range(size): three_d = translate_to_plane(p, xplane=plane) yield three_d for plane in range(size): three_d = translate_to_plane(p, yplane=plane) yield three_d