This is a project for building a simple GUI application that implements BFS and DFS algorithms to find the route for obtaining all the treasures in a maze. The program can read the maze input from a text file, which is expected to have the following specifications:
- K: Krusty Krab (Starting point)
- T: Treasure
- R: Grid that can be accessed or a path
- X: Obstacle grid that cannot be accessed
The program is built in C# using .NET 6.0 framework.
Before you can build and run this program, you will need to have the following tools installed on your system:
- Windows 10 or later
- .NET 6.0 SDK
- Visual Studio or any other IDE that supports .NET development.
- Clone the project repository to your local machine.
- Open the command prompt or terminal and navigate to the project's root directory.
- Run the following command to build the program:
dotnet build src/src.csproj
- If the build is successful, the application executable will be generated in the
bin/net6.0-windows
directory.
- Navigate to the
bin/net6.0-windows
directory - Launch the application by running the following command:
dotnet TreasureHuntSolver.dll
- Or you can double click on the
TreasureHuntSolver.exe
file - Click the "Input File" button to select the maze text file
- Select the search algorithm (BFS, DFS, TSP, Shortest Path, or Shortest Path (TSP)) from the control menu.
- Click the "Search" button to find the route to all treasures.
- The solution path will be displayed in the control menu
- Set the time delay for each progress with "Time in between" slider
- Click the "Visualize" button to visualize the searching process and the final path to all treasures
Here's an explanation for the path's color
- yellow: the path has been accessed
- blue: the path is being accessed
- green: the final path to all treasures
the opacity of the path indicates how often the path accessed by the algorithm/program (kobo)
- If the build failed because of duplicate assembly code, remove all obj folder in
src/Driver
then rebuild using the build instructions command - If the build failed and said "Please restore and try again", run the following command
dotnet restore src/src.csproj
- If you keep getting "Invalid file format" error, make sure the maze text file have the correct format, you can see example text file in the
test
folder
NIM | Name |
---|---|
13521114 | Farhan Nabil Suryono |
13521120 | Febryan Arota Hia |
13521153 | Made Debby Almadea Putri |