Ball Sort Game is a console-based puzzle game where players sort labeled balls into tubes so that each tube contains balls of the same label. This implementation provides multiple search algorithms for solving the puzzle, including:
- Depth-First Search (DFS)
- Breadth-First Search (BFS)
- Dijkstra's Algorithm
- A* (A-Star) Algorithm
- Hill Climbing
- Multiple algorithms to solve the puzzle
- Customizable number of tubes and balls
- Simple text-based input/output for interaction
- No special strategies required to play
- can provide statistics about performance for each algorithm
Ensure you have Python installed on your system (Python 3.x recommended). Then, navigate to the project directory and run:
python driver.py- Each tube can hold a fixed number of balls.
- You can move a ball from one tube to another if the receiving tube has space and either:
- It is empty.
- The top ball in the tube is of the same label as the ball being moved.
- The goal is to sort all balls so that each tube contains only one type of ball.
- DFS (Depth-First Search): Explores paths deeply before backtracking.
- BFS (Breadth-First Search): Searches level by level for the shortest path.
- Dijkstra’s Algorithm: Finds the shortest path considering cost.
- A Algorithm:* Uses heuristics to improve search efficiency.
- Hill Climbing: Greedy algorithm that attempts to make the best immediate move.
You can modify the code by adjusting parameters in the code.
Feel free to fork this project, improve the algorithms, or add new features!