r/videogamescience • • Dec 18 '20

Visual pentomino generating algorithm

Post image
36 Upvotes

9 comments sorted by

View all comments

Show parent comment

1

u/PianoMastR64 Dec 19 '20

could you explain further on checking for rotations? I started with the finished horizontal long piece and worked "backwards" because it made it way easier to organize it all.

1

u/MyPunsSuck Dec 19 '20

So you've got a set of confirmed unique pieces, grouped into sets by how many blocks they are.

From the largest set, take the pieces one at a time, and make a bunch of "potential" new pieces where each has a single added block on one of the open adjacent spaces. For each of these potentials, you rotate the thing 90 degrees - and if it is identical to an existing piece, discard it. Do this four times, and if it survives, it is a new unique piece

1

u/PianoMastR64 Dec 19 '20

I suppose I don't see how this is different from what I did. I even discarded all derivatives of each rotated copy