-
Minh Chien Nguyen
ID: 19110173 -
Phi Anh Pham
ID: 19110512
Puzzle Game
is a game which the player is expected to move pieces in a logical way, in order to reach at the inital state of the provided image, players can also choose any images from their local computers. The game was implemented in Python using Pygame.
A* algorithm
is used in this project to assist identify the quickest path.
- Make sure your machine had installed
python3.9
,pygame
,numpy
andtkinter
. - You are using a Windows machine.
- If you haven't installed any of these, you can install python3.9 and libraries.
pip install pygame
pip install numpy
pip install tkinter
- Locate and open main.py in source folder
src
to play the game. - After clicking on
Shuffle
button, you can use your cursor to interact with the puzzle.
Shuffle
function performs random moves.Solve
funtion solves the Puzzle using A* algorithm.Hint
funtion indicates best move possible so as to reach the initial images.File
funtion uses the selected image in your local machine as the puzzle itself.
https://www.pygame.org/docs/
https://yinyangit.wordpress.com/2010/12/11/algorithm-tim-hiểu-về-bai-toan-n-puzzle-updated/
https://stackoverflow.com/questions/16235564/convert-1d-array-into-numpy-matrix/16235630
https://www.youtube.com/watch?v=XRqA6RQr3SQ&ab_channel=APCRPDEE