diff --git a/.gitignore b/.gitignore index cfe578f..9e51aa9 100644 --- a/.gitignore +++ b/.gitignore @@ -35,4 +35,12 @@ vcpkg_installed/ # visual studio -.vs/ \ No newline at end of file +.vs/ +PathFinding/ + +# Debug builds +x64/ +*.sln +*.vcxproj +*.vcxproj.filters +*.vcxproj.user \ No newline at end of file diff --git a/.vs/PathFinding/FileContentIndex/3444fc50-f9e3-48e6-a03c-37cd5df9510b.vsidx b/.vs/PathFinding/FileContentIndex/3444fc50-f9e3-48e6-a03c-37cd5df9510b.vsidx deleted file mode 100644 index c7a0604..0000000 Binary files a/.vs/PathFinding/FileContentIndex/3444fc50-f9e3-48e6-a03c-37cd5df9510b.vsidx and /dev/null differ diff --git a/.vs/PathFinding/v17/.suo b/.vs/PathFinding/v17/.suo index d24c415..f2c7173 100644 Binary files a/.vs/PathFinding/v17/.suo and b/.vs/PathFinding/v17/.suo differ diff --git a/.vs/PathFinding/v17/Browse.VC.db b/.vs/PathFinding/v17/Browse.VC.db index 62cc319..bfc0e47 100644 Binary files a/.vs/PathFinding/v17/Browse.VC.db and b/.vs/PathFinding/v17/Browse.VC.db differ diff --git a/.vs/PathFinding/v17/DocumentLayout.json b/.vs/PathFinding/v17/DocumentLayout.json index 4c9273c..25af812 100644 --- a/.vs/PathFinding/v17/DocumentLayout.json +++ b/.vs/PathFinding/v17/DocumentLayout.json @@ -1,30 +1,30 @@ { "Version": 1, - "WorkspaceRootPath": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\", + "WorkspaceRootPath": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\", "Documents": [ { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:PathFinding.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Pathfinding.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Maze.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Maze.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Node.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Node.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Maze.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" }, { - "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", - "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Node.h||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" + "AbsoluteMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}", + "RelativeMoniker": "D:0:0:{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}|PathFinding.vcxproj|solutionrelative:Node.cpp||{D0E1A5C6-B359-4E41-9B60-3365922C2A22}" } ], "DocumentGroupContainers": [ @@ -34,17 +34,21 @@ "DocumentGroups": [ { "DockedWidth": 200, - "SelectedChildIndex": 0, + "SelectedChildIndex": 1, "Children": [ + { + "$type": "Bookmark", + "Name": "ST:0:0:{3ae79031-e1bc-11d0-8f78-00a0c9110057}" + }, { "$type": "Document", "DocumentIndex": 0, "Title": "PathFinding.cpp", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp", "RelativeDocumentMoniker": "PathFinding.cpp", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\PathFinding.cpp", "RelativeToolTip": "PathFinding.cpp", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAIAAAAAeAAAA", + "ViewState": "AQIAAAYAAAAAAAAAAAAAAAcAAAAoAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2024-04-13T05:55:35.151Z", "EditorCaption": "" @@ -53,11 +57,11 @@ "$type": "Document", "DocumentIndex": 1, "Title": "Pathfinding.h", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h", "RelativeDocumentMoniker": "Pathfinding.h", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Pathfinding.h", "RelativeToolTip": "Pathfinding.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAAAIAAAATAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAEAAAAcAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", "WhenOpened": "2024-04-14T06:30:42.321Z", "EditorCaption": "" @@ -66,50 +70,50 @@ "$type": "Document", "DocumentIndex": 2, "Title": "Maze.h", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h", "RelativeDocumentMoniker": "Maze.h", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.h", "RelativeToolTip": "Maze.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAABAAAAAyAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAoAAAAfAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", "WhenOpened": "2024-04-13T06:19:48.736Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 3, + "DocumentIndex": 4, "Title": "Maze.cpp", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp", "RelativeDocumentMoniker": "Maze.cpp", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Maze.cpp", "RelativeToolTip": "Maze.cpp", - "ViewState": "AQIAACwAAAAAAAAAAAAAADoAAAAAAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAA4AAAACAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2024-04-13T06:20:09.473Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 5, + "DocumentIndex": 3, "Title": "Node.h", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h", "RelativeDocumentMoniker": "Node.h", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.h", "RelativeToolTip": "Node.h", - "ViewState": "AQIAAAAAAAAAAAAAAAAAABMAAAAVAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAABIAAAAYAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000680|", "WhenOpened": "2024-04-13T06:02:40.99Z", "EditorCaption": "" }, { "$type": "Document", - "DocumentIndex": 4, + "DocumentIndex": 5, "Title": "Node.cpp", - "DocumentMoniker": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp", + "DocumentMoniker": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp", "RelativeDocumentMoniker": "Node.cpp", - "ToolTip": "C:\\Users\\Agrim Budakoti\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp", + "ToolTip": "C:\\Users\\Agrim\\Desktop\\Playground\\Cpp\\Projects\\PathFinding\\Node.cpp", "RelativeToolTip": "Node.cpp", - "ViewState": "AQIAAAcAAAAAAAAAAAAAAAoAAAAAAAAA", + "ViewState": "AQIAAAAAAAAAAAAAAAAAAAUAAAABAAAA", "Icon": "ae27a6b0-e345-4288-96df-5eaf394ee369.000677|", "WhenOpened": "2024-04-13T06:18:44.989Z", "EditorCaption": "" diff --git a/Roboto-Medium.ttf b/Assets/Roboto-Medium.ttf similarity index 100% rename from Roboto-Medium.ttf rename to Assets/Roboto-Medium.ttf diff --git a/Maze.cpp b/Maze.cpp index 3c76f7f..84ef469 100644 --- a/Maze.cpp +++ b/Maze.cpp @@ -14,16 +14,7 @@ Maze::Maze(int width, int height) { grid.push_back(row); } } -void Maze::display() { - for (auto i : grid) { - for (auto j : i) { - std::cout << "(" << j->coords[0] << ", " << j->coords[1] << ") "; - //std::cout << j->coords[0] << j->coords[1] << " "; - } - std::cout << "\n"; - } - std::cout << "\nGrid height: " << gridHeight << "\nGrid width: " << gridWidth; -} + std::array Maze::getNeighbours(Node* target) { int x = target->coords[0]; int y = target->coords[1]; diff --git a/Maze.h b/Maze.h index d0e4b2e..9a20452 100644 --- a/Maze.h +++ b/Maze.h @@ -8,10 +8,9 @@ class Maze { int gridHeight, gridWidth; public: Maze(int width, int height); - std::vector> grid; + // 0: left 1: top 2: right 3: down std::array getNeighbours(Node* target); - void display(); }; int ManhattanDistance(Node* point1, Node* point2); \ No newline at end of file diff --git a/Node.cpp b/Node.cpp index 5319351..81aba12 100644 --- a/Node.cpp +++ b/Node.cpp @@ -3,26 +3,4 @@ Node::Node(int x, int y) { coords[0] = x; coords[1] = y; -} -void Node::display() { - std::cout << "(" << coords[0] << ", " << coords[1] << ") "; -} -void Node::displayState() { - switch (state) { - case Discovered: - std::cout << "Discovered"; - break; - case Undiscovered: - std::cout << "Undiscovered"; - break; - case Goal: - std::cout << "Goal"; - break; - case Start: - std::cout << "Start"; - break; - case Blocking: - std::cout << "Blocking"; - break; - } } \ No newline at end of file diff --git a/Node.h b/Node.h index 9d59bfd..63d8483 100644 --- a/Node.h +++ b/Node.h @@ -7,6 +7,7 @@ enum NodeState { Undiscovered, Goal, Start, + Path, Blocking }; @@ -16,6 +17,4 @@ class Node { std::array coords; NodeState state{Undiscovered}; Node* parent = nullptr; - void display(); - void displayState(); }; \ No newline at end of file diff --git a/PathFinding.cpp b/PathFinding.cpp index 1f299c6..d84e729 100644 --- a/PathFinding.cpp +++ b/PathFinding.cpp @@ -1,18 +1,31 @@ #include "Pathfinding.h" -bool DISPLAY_COORDS{ true }; -int main(){ +// Only need one size because everything is square +constexpr int MAZE_SIZE = 25; +constexpr int WINDOW_SIZE = 1000; - Maze maze(25, 25); - sf::RenderWindow window(sf::VideoMode(1000, 1000), "Path finding"); +constexpr int START_X = 15, START_Y = 17, GOAL_X = 2, GOAL_Y = 2; + +bool DISPLAY_COORDS{ false }; + +int main(int argc, char** argv){ + if (argc > 1) { + if (strcmp("coords", argv[1])) + DISPLAY_COORDS = true; + } + + Maze maze(MAZE_SIZE, MAZE_SIZE); + sf::RenderWindow window(sf::VideoMode(WINDOW_SIZE, WINDOW_SIZE), "Path finding"); sf::Font font; - if (!font.loadFromFile("Roboto-Medium.ttf")) - std::cerr << "Failed to load font"; + if (DISPLAY_COORDS) { + if (!font.loadFromFile("Assets/Roboto-Medium.ttf")) + std::cerr << "Failed to load font!"; + } Node* startNode = nullptr; Node* goalNode = nullptr; - std::array start{ 17,20 }, goal{ 7, 2 }; + std::array start{ START_X,START_Y }, goal{ GOAL_X, GOAL_Y }; for (auto& row : maze.grid) { for (auto& node : row) { @@ -36,6 +49,7 @@ int main(){ if (event.type == sf::Event::Closed) { window.close(); } + if (event.type == sf::Event::MouseButtonPressed) { int cellX = sf::Mouse::getPosition(window).x / 39; int cellY = sf::Mouse::getPosition(window).y / 39; @@ -82,22 +96,31 @@ int main(){ case Undiscovered: // White squareColour = sf::Color(255, 255, 255, 255); break; - case Discovered: // Blue - squareColour = sf::Color(0, 0, 255, 255); + case Discovered: // Gray + squareColour = sf::Color(200, 200, 200, 255); break; case Blocking: // Black squareColour = sf::Color(0, 0, 0, 255); break; - case Goal: // Red + case Goal: // Blue + squareColour = sf::Color(0, 0, 255, 255); + break; + case Start: // Red squareColour = sf::Color(255, 0, 0, 255); break; - case Start: // Yellow - squareColour = sf::Color(255, 255, 0, 255); + case Path: // Green + squareColour = sf::Color(0, 255, 0, 255); break; - default: + default: // White squareColour = sf::Color(255, 255, 255, 255); break; }; + + // Force goal node be coloured red since we set it to discovered when we find it + if (node->coords == goalNode->coords) { + squareColour = sf::Color(0, 0, 255, 255); + } + square.setFillColor(squareColour); square.setPosition(sf::Vector2f(7 + node->coords[0] * 39.4, 7 + node->coords[1] * 39.4)); window.draw(square); @@ -120,7 +143,6 @@ int main(){ } static bool solve(Maze &maze, Node* &start, Node* &goal) { - // Breadth first search std::deque frontier; frontier.push_back(start); @@ -129,19 +151,47 @@ static bool solve(Maze &maze, Node* &start, Node* &goal) { std::cerr << "No solution\n"; return false; } - Node* currentNode = frontier.front(); - frontier.pop_front(); + + // BFS + //Node* currentNode = frontier.front(); + //frontier.pop_front(); + + // DFS + //Node* currentNode = frontier.back(); + //frontier.pop_back(); + + // idk what this is but it works better than BFS and DFS + // Get node closest to the goal node in the frontier and use that + int closestNodeIndex = -1; + for (int i = 0; i < frontier.size(); i++) { + if (closestNodeIndex == -1) { + closestNodeIndex = i; + } + else { + if (ManhattanDistance(frontier[i], goal) < ManhattanDistance(frontier[closestNodeIndex], goal)) { + closestNodeIndex = i; + } + } + } + Node* currentNode = frontier[closestNodeIndex]; + frontier.erase(frontier.begin() + closestNodeIndex); if (currentNode->state == Goal) { - std::cout << "Solved!\n"; + + while (currentNode->parent != nullptr) { + currentNode->state = Path; + currentNode = currentNode->parent; // Backtracking + } return true; } std::array neighbors = maze.getNeighbours(currentNode); + for (auto neighbor : neighbors) { - if (neighbor != NULL && (neighbor->state == Undiscovered || neighbor->state == Goal)) { + if (neighbor != NULL && (neighbor->state == Undiscovered || neighbor->state == Goal || neighbor->state == Path)) { + neighbor->parent = currentNode; frontier.push_back(neighbor); - if (neighbor->state == Undiscovered) + if (neighbor->state == Undiscovered || neighbor->state == Path) neighbor->state = Discovered; } } diff --git a/PathFinding.sln b/PathFinding.sln deleted file mode 100644 index 799d6ad..0000000 --- a/PathFinding.sln +++ /dev/null @@ -1,31 +0,0 @@ - -Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio Version 17 -VisualStudioVersion = 17.9.34723.18 -MinimumVisualStudioVersion = 10.0.40219.1 -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "PathFinding", "PathFinding.vcxproj", "{2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}" -EndProject -Global - GlobalSection(SolutionConfigurationPlatforms) = preSolution - Debug|x64 = Debug|x64 - Debug|x86 = Debug|x86 - Release|x64 = Release|x64 - Release|x86 = Release|x86 - EndGlobalSection - GlobalSection(ProjectConfigurationPlatforms) = postSolution - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Debug|x64.ActiveCfg = Debug|x64 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Debug|x64.Build.0 = Debug|x64 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Debug|x86.ActiveCfg = Debug|Win32 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Debug|x86.Build.0 = Debug|Win32 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Release|x64.ActiveCfg = Release|x64 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Release|x64.Build.0 = Release|x64 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Release|x86.ActiveCfg = Release|Win32 - {2E29F4AA-3298-430E-8DAE-7FDF9DCECC38}.Release|x86.Build.0 = Release|Win32 - EndGlobalSection - GlobalSection(SolutionProperties) = preSolution - HideSolutionNode = FALSE - EndGlobalSection - GlobalSection(ExtensibilityGlobals) = postSolution - SolutionGuid = {8011F763-37D9-4CE9-8D4A-C23BBF7311FC} - EndGlobalSection -EndGlobal diff --git a/PathFinding.vcxproj b/PathFinding.vcxproj deleted file mode 100644 index e8de647..0000000 --- a/PathFinding.vcxproj +++ /dev/null @@ -1,146 +0,0 @@ - - - - - Debug - Win32 - - - Release - Win32 - - - Debug - x64 - - - Release - x64 - - - - 17.0 - Win32Proj - {2e29f4aa-3298-430e-8dae-7fdf9dcecc38} - PathFinding - 10.0 - - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - Application - true - v143 - Unicode - - - Application - false - v143 - true - Unicode - - - - - - - - - - - - - - - - - - - - - true - - - - Level3 - true - WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - - - - - Level3 - true - true - true - WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - Level3 - true - _DEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - stdcpp20 - - - Console - true - - - - - Level3 - true - true - true - NDEBUG;_CONSOLE;%(PreprocessorDefinitions) - true - - - Console - true - true - true - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/PathFinding.vcxproj.filters b/PathFinding.vcxproj.filters deleted file mode 100644 index 95dd762..0000000 --- a/PathFinding.vcxproj.filters +++ /dev/null @@ -1,39 +0,0 @@ - - - - - {4FC737F1-C7A5-4376-A066-2A32D752A2FF} - cpp;c;cc;cxx;c++;cppm;ixx;def;odl;idl;hpj;bat;asm;asmx - - - {93995380-89BD-4b04-88EB-625FBE52EBFB} - h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd - - - {67DA6AB6-F800-4c08-8B7A-83BB121AAD01} - rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms - - - - - Source Files - - - Source Files - - - Source Files - - - - - Header Files - - - Header Files - - - Header Files - - - \ No newline at end of file diff --git a/PathFinding.vcxproj.user b/PathFinding.vcxproj.user deleted file mode 100644 index 966b4ff..0000000 --- a/PathFinding.vcxproj.user +++ /dev/null @@ -1,6 +0,0 @@ - - - - true - - \ No newline at end of file diff --git a/PathFinding/x64/Debug/PathFinding.exe.recipe b/PathFinding/x64/Debug/PathFinding.exe.recipe deleted file mode 100644 index df406a7..0000000 --- a/PathFinding/x64/Debug/PathFinding.exe.recipe +++ /dev/null @@ -1,11 +0,0 @@ - - - - - C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\PathFinding.exe - - - - - - \ No newline at end of file diff --git a/PathFinding/x64/Debug/PathFinding.ilk b/PathFinding/x64/Debug/PathFinding.ilk deleted file mode 100644 index 2e5a067..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.ilk and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.log b/PathFinding/x64/Debug/PathFinding.log deleted file mode 100644 index 87cccbd..0000000 --- a/PathFinding/x64/Debug/PathFinding.log +++ /dev/null @@ -1,22 +0,0 @@ - PathFinding.cpp -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,67): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,67): warning C4244: with -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,67): warning C4244: [ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,67): warning C4244: T=float -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,67): warning C4244: ] -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,39): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,39): warning C4244: with -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,39): warning C4244: [ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,39): warning C4244: T=float -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(102,39): warning C4244: ] -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,72): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,72): warning C4244: with -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,72): warning C4244: [ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,72): warning C4244: T=float -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,72): warning C4244: ] -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,44): warning C4244: 'argument': conversion from 'double' to 'T', possible loss of data -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,44): warning C4244: with -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,44): warning C4244: [ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,44): warning C4244: T=float -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp(111,44): warning C4244: ] - PathFinding.vcxproj -> C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\PathFinding.exe diff --git a/PathFinding/x64/Debug/PathFinding.tlog/CL.command.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/CL.command.1.tlog deleted file mode 100644 index 32b23e2..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/CL.command.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/CL.read.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/CL.read.1.tlog deleted file mode 100644 index 0536fac..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/CL.read.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/CL.write.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/CL.write.1.tlog deleted file mode 100644 index 6b2aa6b..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/CL.write.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/Cl.items.tlog b/PathFinding/x64/Debug/PathFinding.tlog/Cl.items.tlog deleted file mode 100644 index e23311e..0000000 --- a/PathFinding/x64/Debug/PathFinding.tlog/Cl.items.tlog +++ /dev/null @@ -1,3 +0,0 @@ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\Maze.cpp;C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding\x64\Debug\Maze.obj -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\Node.cpp;C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding\x64\Debug\Node.obj -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding.cpp;C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding\x64\Debug\PathFinding.obj diff --git a/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.lastbuildstate b/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.lastbuildstate deleted file mode 100644 index 69046ed..0000000 --- a/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.lastbuildstate +++ /dev/null @@ -1,2 +0,0 @@ -PlatformToolSet=v143:VCToolArchitecture=Native64Bit:VCToolsVersion=14.39.33519:TargetPlatformVersion=10.0.22621.0:VcpkgTriplet=x64-windows: -Debug|x64|C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\| diff --git a/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.write.1u.tlog b/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.write.1u.tlog deleted file mode 100644 index 8e553a5..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/PathFinding.write.1u.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/VcpkgInstallManifestx64-windows.read.1u.tlog b/PathFinding/x64/Debug/PathFinding.tlog/VcpkgInstallManifestx64-windows.read.1u.tlog deleted file mode 100644 index 4e10436..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/VcpkgInstallManifestx64-windows.read.1u.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/link.command.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/link.command.1.tlog deleted file mode 100644 index f30aa18..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/link.command.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/link.read.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/link.read.1.tlog deleted file mode 100644 index 05b2a57..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/link.read.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.tlog/link.secondary.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/link.secondary.1.tlog deleted file mode 100644 index a2eda34..0000000 --- a/PathFinding/x64/Debug/PathFinding.tlog/link.secondary.1.tlog +++ /dev/null @@ -1,2 +0,0 @@ -^C:\USERS\AGRIM BUDAKOTI\DESKTOP\PLAYGROUND\CPP\PROJECTS\PATHFINDING\PATHFINDING\X64\DEBUG\MAZE.OBJ|C:\USERS\AGRIM BUDAKOTI\DESKTOP\PLAYGROUND\CPP\PROJECTS\PATHFINDING\PATHFINDING\X64\DEBUG\NODE.OBJ|C:\USERS\AGRIM BUDAKOTI\DESKTOP\PLAYGROUND\CPP\PROJECTS\PATHFINDING\PATHFINDING\X64\DEBUG\PATHFINDING.OBJ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding\x64\Debug\PathFinding.ilk diff --git a/PathFinding/x64/Debug/PathFinding.tlog/link.write.1.tlog b/PathFinding/x64/Debug/PathFinding.tlog/link.write.1.tlog deleted file mode 100644 index e2f5fd4..0000000 Binary files a/PathFinding/x64/Debug/PathFinding.tlog/link.write.1.tlog and /dev/null differ diff --git a/PathFinding/x64/Debug/PathFinding.vcxproj.FileListAbsolute.txt b/PathFinding/x64/Debug/PathFinding.vcxproj.FileListAbsolute.txt deleted file mode 100644 index 9b3b188..0000000 --- a/PathFinding/x64/Debug/PathFinding.vcxproj.FileListAbsolute.txt +++ /dev/null @@ -1,10 +0,0 @@ -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-graphics-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-window-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-system-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\freetyped.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\zlibd1.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\bz2d.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\libpng16d.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\brotlidec.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\brotlicommon.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\PathFinding\x64\Debug\PathFind.0CB0A427.Up2Date diff --git a/PathFinding/x64/Debug/pathfinding.obj.enc b/PathFinding/x64/Debug/pathfinding.obj.enc deleted file mode 100644 index c6440f3..0000000 Binary files a/PathFinding/x64/Debug/pathfinding.obj.enc and /dev/null differ diff --git a/PathFinding/x64/Debug/vc143.idb b/PathFinding/x64/Debug/vc143.idb deleted file mode 100644 index aadf4f6..0000000 Binary files a/PathFinding/x64/Debug/vc143.idb and /dev/null differ diff --git a/PathFinding/x64/Debug/vc143.pdb b/PathFinding/x64/Debug/vc143.pdb deleted file mode 100644 index ff51a8e..0000000 Binary files a/PathFinding/x64/Debug/vc143.pdb and /dev/null differ diff --git a/PathFinding/x64/Debug/vcpkg.applocal.log b/PathFinding/x64/Debug/vcpkg.applocal.log deleted file mode 100644 index 306af26..0000000 --- a/PathFinding/x64/Debug/vcpkg.applocal.log +++ /dev/null @@ -1,10 +0,0 @@ - -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-graphics-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-window-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\sfml-system-d-2.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\freetyped.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\zlibd1.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\bz2d.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\libpng16d.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\brotlidec.dll -C:\Users\Agrim Budakoti\Desktop\Playground\Cpp\Projects\PathFinding\x64\Debug\brotlicommon.dll diff --git a/Pathfinding.h b/Pathfinding.h index 1717233..e9b6ddf 100644 --- a/Pathfinding.h +++ b/Pathfinding.h @@ -1,9 +1,8 @@ #pragma once #include -#include #include #include "Node.h" #include "Maze.h" -static bool solve(Maze& maze, Node*& start, Node* &goal); \ No newline at end of file +static bool solve(Maze& maze, Node*& start, Node* &goal); // Returns true if we were able to solve the maze \ No newline at end of file diff --git a/x64/Debug/PathFinding.pdb b/x64/Debug/PathFinding.pdb deleted file mode 100644 index ec2d73a..0000000 Binary files a/x64/Debug/PathFinding.pdb and /dev/null differ