Skip to content

hostr/TruckRouter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Truck Router

Truck routing API that takes in a maze as JSON and outputs the solved maze. Uses the A* Algorithm to quickly find the most optimal path. Built with .NET Core 2.0 Web API and MSTest.

How to Run

Visual Studio

Sample Request

  • Multiline strings aren't valid JSON so use this link to convert to a JSON string array
  • Using a string array instead of single string with newline characters so we can keep the nice multiline formatting
  • # is a wall, A is the starting point, B is the destination, and . are open points
{
  "maze": [
    "##########",
    "#A...#...#",
    "#.#.##.#.#",
    "#.#.##.#.#",
    "#.#....#B#",
    "#.#.##.#.#",
    "#....#...#",
    "##########"
  ]
}

Sample Response

  • Outputs the same maze with @ as the most optimal path
{
  "steps": 14,
  "solution": [
    "##########",
    "#A@@.#...#",
    "#.#@##.#.#",
    "#.#@##.#.#",
    "#.#@@@@#B#",
    "#.#.##@#@#",
    "#....#@@@#",
    "##########"
  ] 
}

Credit to WichardRiezebos for implementation of the A* Algorithm.

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages