hp
toc

Sliding Puzzle

2016-04-16, post № 117

games, programming, Pygame, Python, #apple, #piece, #tile, #tile game, #tile sliding, #tiles

This is my version of a sliding puzzle.
A sliding puzzle is based on a number of tiles (15 in this case) which are scrambled.
The objective of the game then is to slide the tiles around and get back to the original image.
As an image I took a photo of an apple in front of a black background.For more information on sliding puzzles, check this Wikipedia entry.

Controls

  • ‘F1’ takes a screenshot,
  • ‘F2’ starts and stops scrambling the image,
  • ‘F3’ solves the puzzle,
  • Mouse clicks slide tiles.
sliding-puzzle-0.png
sliding-puzzle-1.png
sliding-puzzle-2.png
Source code: sliding-puzzle.py
Jonathan Frech's blog; built 2024/12/19 23:13:08 CET