Skip to content

Commit

Permalink
Create ReadMe.md
Browse files Browse the repository at this point in the history
  • Loading branch information
Da-an committed Jan 6, 2016
1 parent 9b4a2ec commit 4568e19
Showing 1 changed file with 27 additions and 0 deletions.
27 changes: 27 additions & 0 deletions ReadMe.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
## A* algorithm [![Build Status](https://travis-ci.org/da-an/a-star.svg?branch=master)](https://travis-ci.org/da-an/SHA-1)
A* search algorithm written in C++ programming language.
- requires compiler support for C++11

#### Usage example
```cpp
#include <iostream>
#include "source/AStar.hpp"

int main()
{
AStar::Generator generator;
// Set 2d map size.
generator.setWorldSize({25, 25});
// You can use a few heuristics : manhattan, euclidean or octagonal.
generator.setHeuristic(AStar::Heuristic::euclidean);
generator.setDiagonalMovement(true);

std::cout << "Generate path ... \n";
// This method returns vector of coordinates from target to source.
auto path = generator.findPath({0, 0}, {20, 20});

for(auto& coordinate : path) {
std::cout << coordinate.x << " " << coordinate.y << "\n";
}
}
```

0 comments on commit 4568e19

Please sign in to comment.