Introduction

Jigsaw is a puzzle game in which players assemble segments of a picture into their correct relative positions. The jigsaw picture is either an image file - say a photograph - or one created by the program's built-in pattern generators. The selected image will be broken into square tiles which the player can move around the screen until they are assembled correctly.

Contents

Square tiles! Yes, using square tiles removes the possibility of recognising pieces that match based on their shape and so makes the puzzle harder, especially if the option to randomly rotate the pieces by multiples of 90 degrees is invoked.

Puzzle creation is instantaneous and the player can immediately start using the mouse to move the pieces around and to join them together. Whenever a piece is released close enough to a piece it matches the program will snap them together to form a single chunk. This process is continued until the picture is completely reassembled. If the player gets stuck a hint can be requested by clicking the wand icon at the top of the display. This will cause a piece which fits the largest current chunk to move to the top left of the display, from where the player can drag it to its correct location. Alternatively, a further click on the wand will automatically position the hint piece.

Please note that the jigsaw program requires additional software: The Python Imaging Library (PIL) in order to run. Although PIL runs on Linux, Mac OS X and Windows users may need to find out how to install it on their particular system.

Summary

A program for creating and solving jigsaw-like puzzles. It can make puzzles from player's digital photos of from a range of generated patterns. The player selects an image file or pattern and the program will scale it in accordance with the current settings and then display it as a set of randomly scattered square tiles. As a solving aid a faint image of the original image is displayed beneath the scattered tiles. The player uses the mouse to move the tiles around and put them together in the correct order. Grab a piece with the left mouse button. Drop it by releasing the button. If the tile is sufficiently close to a piece it fits the two will automagically be joined and subsequently move together as a single piece. Continue until the whole image is recreated.

The puzzle is displayed and solved on a notional table and the player can select image size and the table size in the following way. Before loading a new photo or pattern resize the window to the desired image size. Then load the picture or pattern. If it is larger than the current window it will be scaled to just fit. Now, to make space for the puzzle pieces make the window larger (the image will not change size), then click on the picture icon. The puzzle will be created and the pieces scattered.

The program contains two methods for generating pictures. The first, named in the menu as "Patterns", produces aperiodic tiling patterns. These are created by repeated divisions of an initial shape. The player can choose the Pattern, the number of divisions, the drawing style and the colours used. The second type of patterns, named as "L-Systems" in the menu, often contain a great deal of symmetry and hence create much more difficult jigsaws. The player can choose the pattern, the drawing style and the colours.

At the top of the display is a Toolbar. The jigsaw piece button at the left is a menu which has options for selecting a picture file, choosing a Pattern or L-System, the number of puzzle pieces, and whether or not the puzzle pieces should be randomly rotated through multiples of 90 degrees when scattered on the table. There are also options for configuring the aperiodic patterns and their colours, the table colour, and one for saving the current settings. The option to switch animation on or off refers only to the program's creation of patterns and generally should be set "Off". If animation is "On" the program will show the processes it goes through to build up the different patterns. The animation option is included for those who may be interested in such things and in fact the images produced when animation is "On" cannot be used to generate puzzles! To generate similar images to use as puzzles, animation must be set to "Off".

To the right of the puzzle icon is the photo icon used to start a new game by creating and scattering the current tiles. To the right of the photo icon is a wand. If you get stuck, clicking on the wand will cause the program to find a piece which fits the largest current chunk of puzzle, and move it to the top left corner of the table. From here it can be dragged and joined to its neighbours. If you are unable to recognise where the piece fits, a second click on the wand will cause the piece to move to the correct location (though you must click on it to make the join). To the right of the wand is a sad smiley icon. If you give up on solving the puzzle, a click on the sad smiley will start an animation which will finish the puzzle. Right again is a clock which ticks every 5 seconds. If puzzles are generated with the tiles randomly rotated, right clicking on a tile will rotate it 90 degrees. The brightness of the background image can be altered by clicking it with the middle mouse button. This cycles round so just keep clicking!

Jigsaw Example

A video from jigsaw showing two puzzles being completed. The first an image file and the second a built in pattern. First the board is set to the desired image size, and then the file is read in and automatically scaled to fit the board. Next the board is enlarged to make space for the jigsaw pieces. Then the pieces are created and scattered about the board. Finally the puzzle is solved using the mouse. The same steps are used for the pattern. To save time for the demonstation the puzzles have been broken into the minimum number of pieces.

Completion Animations

For amusement purposes the program includes three different animations for completing puzzles when the player gives up and clicks the sad smiley. The default option "Quick" is to simply slide the unconnected tiles straight into their finishing positions. The second option "Bounce" treats the tiles as though they are objects which are subject to physical forces rather like ghostly snooker balls. It explodes the tiles which then bounce off the edges of the window, but due to a force of attraction, gradually settle down into their final correct positions. The third option "Flock" treats the tiles as a flock of birds. Starting from random positions, their mutual attraction slowly brings them together into a tight flock. When a tile passes sufficiently close to its final position it will leave the flock and perch there. The flocking activity is coded as forces which encourage their movement towards the centre of the flock, towards the overall direction of the flock, and to avoid collisions. Examples of these three animations are shown in the following videos.

Quick Example

A video from jigsaw showing the quick animation for completing a puzzle.

Bounce Example

A video from jigsaw showing the bounce animation for completing a puzzle.

Flock Example

A video from jigsaw showing the flock animation for completing a puzzle.

Patterns

Though it may appear otherwise when confronted by a puzzle created by one of the game's aperiodic tiling patterns, these patterns were selected because, as they contain no translational symmetry, they should be relatively easy to solve. A few examples are shown below.

So far five basic pattern types are available: Pinwheel Triangles, Danzer Triangles, Robinson Triangles, Penrose Rhombs and The Chair.

Each tiling pattern is created by repeated divisions of an initial shape and the number of divisions can be selected.

Further variety of pattern can be produced by selecting from a range of different ways or "styles" when drawing the images. Drawing styles are "Outline", "Random", "Orientation" and "Type". Some styles are not applicable to a particular pattern, eg all Pinwheel triangles are equivalent and so have no "Type". When a style does not apply the program will render style "Outline".

The colours are numbered 1 - 9 and can be selected independently. Colour 9 is used for drawing outlines, the others for filling: Colour 1 is used for filling style "Outline"; Colour 2, Colour 3, Colour 4, Colour 5 for styles "Type" and "Orientation". All colours are used for filling draw style "Random". Imaginative choice of colours can further increase the variety of patterns.

Videos showing animations of some of the patterns being built are available on the Patterns Coding page.

L-Systems

The L-Systems patterns provide more difficult images as they are generally more repetitive. Most of the examples given below (starting with Koch a) were taken from The Algorithmic Beauty of Plants.

Videos showing animations of some of the patterns being built are available on the L-Systems Coding page.

Examples

Pinwheel

Pinwheel

A Pinwheel Example

Pinwheel

Pinwheel

A Pinwheel Example

Pinwheel

Pinwheel

A Pinwheel Example

Danzer

Danzer

A Danzer Example

Danzer

Danzer

A Danzer Example

Danzer

Danzer

A Danzer Example

Robinson

Robinson

A Robinson Example

Robinson

Robinson

A Robinson Example

Robinson

Robinson

A Robinson Example

Rhombs

Rhombs

A Rhombs Example

Rhombs

Rhombs

A Rhombs Example

Rhombs

Rhombs

A Rhombs Example

Rhombs

Rhombs

A Rhombs Example

Chair

Chair

A Chair Example

Chair

Chair

A Chair Example

Chair

Chair

A Chair Example

Chair

Chair

A Chair Example

Chair

Chair

A Chair Example

Koch a

Koch a

A Koch a Example

Koch b

Koch b

A Koch b Example

Koch c

Koch c

A Koch c Example

Koch d

Koch d

A Koch d Example

Koch e

Koch e

A Koch e Example

Koch f

Koch f

A Koch f Example

Islands and Lakes

Islands and Lakes

An Islands and Lakes Example

Quadratic Koch Island

Quadratic Koch Island

A Quadratic Koch Island Example

Quadratic Snowflake

Quadratic Snowflake

A Quadratic Snowflake Example

Dragon

Dragon

A Dragon Example

Plant 3

Plant 3

A Plant 3 Example

Plant 1

Plant 1

A Plant 1 Example

Plant 2

Plant 2

A Plant 2 Example

Plant 4

Plant 4

A Plant 4 Example

Plant 5

Plant 5

A Plant 5 Example

Plant 6

Plant 6

A Plant 6 Example

Sierpinski Carpet

Sierpinski Carpet

A Sierpinski Carpet Example

Sierpinski Gasket

Sierpinski Gasket

A Sierpinski Gasket Example

Penrose

Penrose

A Penrose Example