New puzzle game: Polyominoes

124 views
Skip to first unread message

Andy Lewis

unread,
Feb 4, 2021, 11:13:11 AM2/4/21
to brython
Hello again

Here is another puzzle game following on from Dominate and Tangrams. In case you haven't heard of them, polyominoes are shapes formed by sticking squares together.  The most famous are probably tetrominoes, as used in the game Tetris.
For these puzzles you have to fill a variety of shapes with polyominoes, by rotating, reflecting and dragging them.

To help you out, there is a "Check/Get hint" button which tells you whether the puzzle is solvable from the position you have reached. If it is, you can ask for one or more extra pieces to be added. If it is not, you can ask for pieces to be removed to take you back to a solvable position.

To provide this facility, I needed to write a "solver". This is written in Javascript, as unfortunately the Brython version ran too slowly (sorry Pierre! ;-) ). But the rest of it is all Brython - no other frameworks/packages except my own brySVG and brywidgets.

There are 5 different tetrominos (counting rotations and reflections as the same). That's a bit small to do much with, so here are 10 puzzles using two sets of tetrominoes:

There are 12 different pentominoes; here are 20 puzzles using those:

There are 35 different hexominoes, which is rather a lot; here are 10 puzzles using either a subset or all of them:

Kiko

unread,
Feb 4, 2021, 11:38:55 AM2/4/21
to bry...@googlegroups.com
Pretty cool!!

Thanks for sharing.
> --
> You received this message because you are subscribed to the Google Groups
> "brython" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to brython+u...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/brython/697ad76e-9c33-44a1-91bd-52a2ec481ed1n%40googlegroups.com.
>

Andy Lewis

unread,
Feb 11, 2021, 10:50:02 AM2/11/21
to brython
Thank you, Kiko.  Just to say I have carried out a major tidy-up of the code (I hope nobody looked at it before, it was a bit of a mess even though it all worked).

There is not much apparent change to the user - mainly improvements to how it looks on smaller screens like tablets and phones, and  it now responds correctly if the screen is rotated. (I still wouldn't recommend playing it on a small phone though, unless you have small fingers!)

Best wishes

Andy
Reply all
Reply to author
Forward
0 new messages