https://github.com/maguids/game-klotski
Version of the game "PuzzlePacked IQ games" in terminal with search algorithms. Second Semester of the First Year of the Bachelor's Degree in Artificial Intelligence and Data Science.
https://github.com/maguids/game-klotski
astar-algorithm bfs-algorithm greedy-algorithm klotski python3
Last synced: 5 days ago
JSON representation
Version of the game "PuzzlePacked IQ games" in terminal with search algorithms. Second Semester of the First Year of the Bachelor's Degree in Artificial Intelligence and Data Science.
- Host: GitHub
- URL: https://github.com/maguids/game-klotski
- Owner: Maguids
- Created: 2024-01-25T14:18:27.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-01-22T21:34:31.000Z (5 months ago)
- Last Synced: 2025-02-26T13:15:57.355Z (4 months ago)
- Topics: astar-algorithm, bfs-algorithm, greedy-algorithm, klotski, python3
- Language: Python
- Homepage:
- Size: 256 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Game - Kslotski (Terminal Version)
This project was developed for the "Elements of Artificial Intelligence and Data Science" course and aims to **develop and implement a solitaire game**. The project should include the use of **heuristic search methods and uninformed search methods** that should be able to **solve different versions or levels of this game.**
---
## Programming Language:
![]()
## Requirements:
- python version 3.8.10
This was the tested requirement.
## Running the Game:
In order to start the game, just run:```bash
python3 start.py
```## About the Game:
### How to play:
Klotski is a version of the "PuzzlePacked IQ games", in which the objective of the game is to move the largest block and position it in the right place. To do this, you need to move a set of smaller blocks, allowing the larger block to move. Each block occupies one or more cells, and blocks can move in any of the four cardinal directions (up, down, left, or right) as long as there are no obstacles in the way.### Search Algorithms:
- **Breadth-First Search (BFS)**;
- **Greedy Best-First Search** - with Manhattan distance;
- **A\* Algorithm** (A Star) - with Manhattan distance.### Features:
- Possibility to **choose different boards with different levels of difficulty**;
- Possibility to return to the **Menu** at any time by typing 'menu'
- It is possible to **restart** the chosen level by typing 'r';
- Possibility to **end the game** at any time by typing 'quit';
- Option to **choose the desired search algorithm**;
- **Hint function**, which varies depending on the search algorithm used, which shows the next possible move, just type 'hint'.
## About the repository:
In the folder "Klotski - Terminal", you can find several files, each of which is assigned to a specific set of tasks, which are:- levels.py ➡️ Has five different game boards of each of the three difficulties;
- creat_board.py ➡️ Function that allows to create the board depending on the chosen level;
- game.py ➡️ Development of the game Klotski, has all the functions that allows it to work;
- menu_terminal.py ➡️ Explains the functionalities of the game and lets you choose the level and the difficulty;
- play_in_terminal.py ➡️ Starts the game according to what was chosen in the menu and allows you to use 'Hint';
- a_star.py ➡️ Development of A*;
- bfs.py ➡️ Development of BFS;
- greedy.py ➡️ Development of Greedy;
- start.py ➡️ Starts the functioning of everything;Note: The development of the search algorithms' operating mode is based on the way the game was created
## Link to the course:
This course is part of the **second semester** of the **first year** of the **Bachelor's Degree in Artificial Intelligence and Data Science** at **FCUP** and **FEUP** in the academic year 2022/2023. You can find more information about this course at the following link: