Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rafaelbarbosatec/a_star

Package that uses the A * algorithm to find a way to the destination through the barriers.
https://github.com/rafaelbarbosatec/a_star

dart flutter flutter-package

Last synced: about 21 hours ago
JSON representation

Package that uses the A * algorithm to find a way to the destination through the barriers.

Awesome Lists containing this project

README

        

[![pub package](https://img.shields.io/pub/v/a_star_algorithm.svg)](https://pub.dev/packages/a_star_algorithm)

# a_star_algorithm

![](https://github.com/RafaelBarbosatec/a_star/blob/main/img/example.jpg)

A* algorithm

# Usage
To use this package, add `a_star_algorithm` as a [dependency in your pubspec.yaml file](https://docs.flutter.dev/packages-and-plugins/using-packages).

### Example

``` dart
import 'dart:math';
import 'package:a_star_algorithm/a_star_algorithm.dart';
Iterable result = AStar(
rows: 20,
columns: 20,
start: Point(5,0),
end: Point(8,19),
barriers: [
Point(10,5),
Point(10,6),
Point(10,7),
Point(10,8),
],
).findThePath();
```

[Demo Online](https://rafaelbarbosatec.github.io/a_star/)